Skip to main content
11-Garnet
June 12, 2024
Solved

How to create a WTChangeRequest2 with Affected Objects and Affected End Items using API

  • June 12, 2024
  • 2 replies
  • 1666 views

As per the original post

 

Hi @Manoj_Dokku4 , @HelesicPetr 

 

how can we get Affected End Item of Affected Objects??

Best answer by AA_9841156

Hi @anursingh ,

 

As implemented below API 

QueryResult usedBy = StructHelper.service.navigateUsedByToIteration(inputPart, true,
new WhereUsedConfigSpec()); in recursive call and get Parent End Item and add in affected end item table.

SubjectProduct subjectProduct = SubjectProduct.newSubjectProduct(endItemMaster, newServiceChangeRequest);

 

its working !!!

2 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
June 12, 2024

Hi @AA_9841156 

What do you mean Affected EndItem of Affected Object?

The Affected End Item is object added to the Affected End Items Table and this is not related to the affected table. 

So if you need to get Affected End Item objects then you can get it from Change Object as request issue etc.

PetrH

11-Garnet
June 12, 2024

Hi @HelesicPetr 

 

Actually I am creating CR through API and able to add Affected objects in Affected Objects table through code but not able to add affected end item based on objects that are affected in affected end item table so thats why i am looking API to find Affected End items of objects that are affected 

HelesicPetr
22-Sapphire II
22-Sapphire II
June 12, 2024

Hi @AA_9841156 

There is not an Api that could collect what end item can be affected from the affected table.

You have to write own code to find parent End Item WTPart of the affected object and this end Item you can add to the Affected End Item table. 

 

PS> check following code

NmHelperBean helperBean= ((JcaComponentParams)componentParams).getHelperBean();
NmCommandBean nmCommandBean= helperBean.getNmCommandBean();
ChangeItemQueryCommands.getAffectedEndItems(nmCommandBean);

the getAffectedEndItems collects Affected End Items from change object. 

PetrH

Community Moderator
June 24, 2024

Hi @AA_9841156,

 

I wanted to follow up with you on your post to see if your question has been answered. 
If so, please mark the appropriate reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so that we can continue to help you. 

 

Thanks,
Anurag
 

AA_984115611-GarnetAuthorAnswer
11-Garnet
June 25, 2024

Hi @anursingh ,

 

As implemented below API 

QueryResult usedBy = StructHelper.service.navigateUsedByToIteration(inputPart, true,
new WhereUsedConfigSpec()); in recursive call and get Parent End Item and add in affected end item table.

SubjectProduct subjectProduct = SubjectProduct.newSubjectProduct(endItemMaster, newServiceChangeRequest);

 

its working !!!

HelesicPetr
22-Sapphire II
22-Sapphire II
June 25, 2024

So @AA_9841156 

You have done what I wrote 😄 

PetrH