Skip to main content
11-Garnet
Jun 12, 2024 10:58 AM UTC
Solved

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

As per the original post. 

 

Hi @Manoj_Dokku4 , @HelesicPetr 

 

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

11-Garnet
Jun 25, 2024 4:23 AM UTC

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 !!!

7 replies

HelesicPetr
22-Sapphire II
Jun 12, 2024 11:22 AM UTC

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

Translate
11-Garnet
Jun 12, 2024 12:22 PM UTC

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 

Translate
HelesicPetr
22-Sapphire II
Jun 12, 2024 1:52 PM UTC

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

Translate
Community Moderator
Jun 24, 2024 9:10 PM UTC

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
 

Translate
AA_984115611-GarnetAuthorAnswer
11-Garnet
Jun 25, 2024 4:23 AM UTC

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 !!!

Translate
HelesicPetr
22-Sapphire II
Jun 25, 2024 8:08 AM UTC

So @AA_9841156 

You have done what I wrote 😄 

PetrH

Translate