Copy Select field from Jira Product Discovery to Cascading Field in Jira Software project

Jeffrey Crime November 5, 2024

Hello all!

I am trying to write automation that copies a field from Jira Product Discovery to a Jira Software Project.  It is not a 1:1 copy however due to the Jira product Discovery field being a 'Select' field and the Jira Software project being a 'Cascading' Field.  

 

In my specific example, I am trying to copy the value from field "Product-Feature Pair" in Product Discovery to "Product-Feature Pair" in Jira software project.  It is not as simple as copying from the destination issue as it is not a 1:1 translation into the Jira software project field of the same name (See screenshots). 

Would anyone know what I may be missing in the "Edit Issue Fields" Section that may allow me to copy the correct value into the Jira software project field?Automation1.png

Automation2.png

Thanks!!

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 5, 2024

Hi @Jeffrey Crime 

First thing, for your scenario you are using data from an issue in one project to edit an issue in another project.  And so your rule will need to have multiple-project or global scope.  Please work with your Jira Site Admin to make that setting change for the rules.

 

Next, as the fields are different types you will need to use a JSON expression to edit the fieldhttps://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Cascading-select-custom-field

Let's assume your source field in the JPD Idea contains values like this for the "Product-Feature Pair", where there is some delimiter between the values:

  • Big product-Feature A
  • Big product-Feature B
  • Little product-Feature 23
  • ...

And so the rule will need to split the value into the "product" and "feature", using text functions such as split() or substringBefore(), and use those in the JSON expression.

 

Finally, when do you want these values synchronized between the issues?  There are several possible cases when the issues could be connected, and knowing that will help you to create the necessary rules.  For example:

  • when a software project issue (e.g., Epic) is linked to a JPD Idea as a "delivery ticket", set the field
  • when a software project issue is unlinked from a JPD Ideas, do ???
  • when the JPD Idea's value for "Product-Feature Pair" changes, update any linked "delivery tickets"
  • when someone manually changes a software project issue's "Product-Feature Pair", update it to re-synch it to any connected JPD Idea's value
  • FYI, there is no referential integrity (RI) for the "delivery ticket" links in JPD.  What should happen if a software project's issue is linked to multiple JPD Ideas?

 

Kind regards,
Bill

Jeffrey Crime November 5, 2024

Thanks Bill!  I understand about the triggers of when this automation should take place.  As well as the global permissions for this kind of rule.    For now I was focusing on the actual copying of the one field from JPD to the cascading field which I will try with the JSON expressions and get back with results.  Thanks again!

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 5, 2024

Glad to help, and...if you run into challenges creating the expression, please post what you used so the community can help.

Jeffrey Crime November 19, 2024

Had to come back to this.  I thought maybe If I mapped the Select List field in Product Discovery is named "Product-Feature Pair", with the values being simple options like Option 1, Option 2, Option 3, that it might work.  Splitting the string might be a little complicated since the text is variable between the 'Parent' and 'Child' values of the cascading field.  

This JSON did not seem to work with me trying to manually map each value in the JSON.  Is there a part to the Automation or JSON I may be missing?  

Thanks again

Automation1.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2024

First, I notice the edit issue action has the Product-Feature Pair field selected from the dropdown (clearing it) and trying to update it with the JSON.  I recommend removing it from the selected field list and only using the JSON.

 

Next, your JSON syntax to set the fields is incorrect.  That link I provided has more information at the top about the entire structure for setting a field. 

For example, with a made up custom field id:

{
"fields": {
"customfield_12345" : {
"value": "{{triggerIssue.customfield_12345.value}}",
"child": {
"value" : "{{triggerIssue.customfield_12345.child.value}}"
}
}
}
}

To find the correct custom field id for your Product-Feature Pair field, please use this how-to article:

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

Finally, I used the {{triggerIssue}} in my example.  Please use the relevant one for your needs.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events