# How to link a Bug to a Feature within Exalate and ADO

**URL:** <https://community.exalate.com/t/how-to-link-a-bug-to-a-feature-within-exalate-and-ado/5563>\
**Category:** General Questions\
**Tags:** cloud-salesforce, exalate, cloud-jira, migrated\_question\
**Created:** [November 4, 2024, 8:13am UTC](https://community.exalate.com/t/how-to-link-a-bug-to-a-feature-within-exalate-and-ado/5563 "2024-11-04T08:13:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:13am UTC](https://community.exalate.com/t/how-to-link-a-bug-to-a-feature-within-exalate-and-ado/5563/1 "2024-11-04T08:13:10Z")

</div>

_Originally asked by Kaleigh Garcia on 16 August 2023 [(original question)](https://oldcommunity.exalate.com/questions/88245852)_

* * *

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?

replica.ParentId = ‘34920’;

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:13am UTC](https://community.exalate.com/t/how-to-link-a-bug-to-a-feature-within-exalate-and-ado/5563/2 "2024-11-04T08:13:17Z")

</div>

_Answer by Syed Majid Hassan on 18 August 2023_

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:

```auto
workItem.parentId = "34920"

```

There is an extremely in depth post on the subject of hierarchies in ADO [here](https://community.exalate.com/display/exacom/Jira+Cloud+Azure+DevOps%3A+Bi-directional+hierarchy+sync).

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
> 
> ```auto
> /* SFDC ADO OUTGOING */
> if (entity.entityType == "XXXXX__c") {
> 
> replica.Name = entity.Name
> replica.Summary __c = entity.Summary__ c
> replica.Description __c = entity.Description__ c
> replica.Priority __c = entity.Priority__ c
> replica.Severity __c = entity.Severity__ c
> replica.IsPostRelease __c = entity.IsPostRelease__ c
> replica.attachments = entity.attachments
> replica.RecordTypeName __c = entity.RecordTypeName__ c
> replica.CaseType __c = entity.CaseType__ c
> replica.Module __c = entity.Module__ c
> replica.StepsToReproduce __c = entity.StepsToReproduce__ c
> replica.DueDate __c = entity.DueDate__ c
> replica.CriticalClinicalImpact __c = entity.CriticalClinicalImpact__ c
> replica.ParentId = entity.ParentId;
> }
> 
> if(entity.entityType == "XXXXX" && entity.RecordTypeName__c == "XXXXX") {
> //replica.projectName = "XXXXXX"
> replica.projectName = 'Salesforce Connector'
> replica.issueTypeName = "Bug"
> }
> 
> if(entity.entityType == "XXXXX" && entity.RecordTypeName __c == "XXXXX" && entity.IsPostRelease__ c == false) {
> replica.Summary__c = '[' + entity.Name + '] ' + entity.Summary__c
> replica.ParentId = '59523';
> }
> 
> if(entity.entityType == "XXXXX" && entity.RecordTypeName__c == "XXXXXO" && XXXXX == true) {
> replica.Summary__c = '[' + entity.Name + ' XXXXX] ' + entity.Summary__c
> replica.ParentId = '59536';
> }
> 
> if (entity.entityType == "XXXXX" && entity.RecordTypeName__c == "XXXXx") {
> //replica.projectName = "XXXXX"
> replica.projectName = 'DevOps Test'
> replica.issueTypeName = "Defect"
> replica.Summary __c = entity.Summary__ c
> }
> 
> ```

> **Kaleigh Garcia commented on 18 August 2023**
>
> > 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)_

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 8:13am UTC](https://community.exalate.com/t/how-to-link-a-bug-to-a-feature-within-exalate-and-ado/5563/3 "2024-11-06T08:13:20Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
