Hello! I’m working with my team to attempt to link a Bug Work Item to a Feature Parent. I’m using the line below to attempt the linking… am I doing something wrong? Is ParentID not the right assignment?
Without knowing the exact nuances of what things are involved in this integration, it is a little hard to say, but I can definitely see something wrong with that line i.e. you are using the word replica!
I believe the line should be:
workItem.parentId = "34920"
There is an extremely in depth post on the subject of hierarchies in ADO here.
Hopefully this helps you get over the line!
Thanks
Majid
Comments:
Kaleigh Garcia commented on 18 August 2023
This is the full script. It seems like my dev team set it up using replica instead of workitem. Does that matter? Also new to Groovy. Syed Majid Hassan
Syed Majid Hassan , I’m using Exalate to sync Salesforce to ADO if that’s helpful. It seems to use replica. to move info to ADO. I think then I need to use your text above in the incoming script within ADO to set the workitem. Thank you for the help!
Syed Majid Hassan commented on 19 August 2023
Kaleigh Garcia So each side (SF and ADO) have their own copies of Incoming and Outgoing.
The outgoing packages the replica e.g. consider the line
replica.summary = entity.summary
This line picks the SF summary and packages it into the data structure called replica.
And yes, this replica is the object that is actually transported to the other side.
Now in the ADO incoming script, you will see a line similar to:
workItem.summary = replica.summary
This line is picking the summary from replica (so, basically the SF summary), and updating the workItem summary.
Parent child hierarchies are a little tricky. Consider the line in question here:
workItem.parentId =``"34920"
Now this line only makes sense in the ADO Incoming (you are correct) and the behavior of this line would be that whatever workitem is being worked on, will be made a child of 34920. If this is what you want, problem solved. But usually, these sort of lines are in an if block e.g.
if (replica.type.name == “Subtask”)
workItem.parentId \= "34920"
Note: This is just pseudo code meant to help you with the logic (I haven’t tested it).
Thanks
Majid
Kaleigh Garcia commented on 21 August 2023
This is very helpful! Thanks, Syed Majid Hassan (old community)