Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy custom field [Select List (multiple choices)] from linked issue

Martin Kovalcik
Contributor
March 10, 2025 edited

 

Hi, I can't figure out how to copy [Select List (multiple choices)] custom field from linked issue.

Other fields work fine.

 

image.png

 

I need to copy one more custom field - customfield_10177.

The type of this field is Select List (multiple choices).

Smart value {{issue.issuelinks.inwardIssue.customfield_10177}} doesn't work.

 

I want the rule to be manually triggered from the edited issue.

 

  • both projects are company-managed
  • image of my rule

    image.png

 

  • image of my Edit issue action

    image.png
  • image from audit log

    image.png

1 answer

1 accepted

1 vote
Answer accepted
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.
March 10, 2025 edited

Hi @Martin Kovalcik 

For a question like this, context is important for the community to help.  Please post the following:

  • what type of project is this (e.g., company-managed, team-managed, etc.), 
  • an image of your complete automation rule in a single image for continuity,
  • images of any relevant actions / conditions / branches,
  • an image of the audit log details showing the rule execution, and
  • explain what is not working as expected and why you believe that to be the case.

Until we see those...

Have you confirmed that each of those field edits actually works as you expect?  The concern is two-fold:

  • While the {{issue.issuelinks}} field contains some of the fields for the linked issues, it does not contain them all.  Generally, one needs to use the Lookup Issues action with JQL, or a branch, to fully load the issue data before use in other rule steps / actions.
  • When accessing something like {{issue.issuelinks.inwardIssue.customfield_12345}} that could be a list of values when there are multiple linked issues.  As a result, there could be unexpected results.  This is another reason to specifically select the issue needed, with with smart value, list filtering or the Lookup Issues action.

 

Next, for multiple-select option field, you may need to use JSON to add the values: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-select-custom-field

If we assume the data for customfield_10177 is actually loaded with the issuelinks smart value, and there is one-and-only-one issue in the inwardIssue attribute, this might work with the function asJsonObjectArray():

{
"fields": {
"customfield_10177": {{issue.issuelinks.inwardIssue.customfield_10177.asJsonObjectArray("value")}}
}
}

 

Kind regards,
Bill

Martin Kovalcik
Contributor
March 10, 2025 edited

there is only one linked issue and the copied custom fields exist in both issues

the type of source and destination customfield_10177 is [Select List (multiple choices)] and the valid options for this field are also the same

other copied custom fields work exactly as I wanted

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.
March 10, 2025

I was not noting the fields exist (or not) in the issue types used.  But instead that the {{issue.issuelinks}} smart value does not load all of the associated data by default for a specific issue.  If it did, one could imagine a situation were a single issue with linked ones could pull thousands of others, in an ever increasing tree of links, including duplicates of the same issue.  Regardless of that...

 

Did you try the JSON expression I suggested rather than setting the field from the dropdown list?

Martin Kovalcik
Contributor
March 11, 2025

there is only one linked issue (source) from which I am trying to copy values to my trigger issue

I added some images of my rule, so you can see that I tried JSON expression you suggested and there is also an image with an error from the audit log

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.
March 11, 2025

Thanks for the updated information, and...for the issue shown in the log, RT-1, it seems that field is not available.

Can you set that field manually from the Jira UX to confirm it is editable?

Have you tried this how-to article to determine if the field is supported by rules for edits: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

Martin Kovalcik
Contributor
March 18, 2025 edited

the field Proces (customfield_10177) is available in RT-1 as you can see from this screenshot 

image.png

 

I didn't read the article you suggested yet but I think my field can be edited by rules, because I created another rule, which is triggered automatically from the source issue when the link is created and the fields are populated just fine

image.png

 

So I am asking again, is there any way how can I populate the fields by using my manually triggered rule (triggered from destination issue)? 

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.
March 18, 2025

The "destination issue" is only relevant for the issue linking triggers.

 

For all others, such as Manually Trigger, the rule must go get the issue data.  When you want to update the trigger issue from another one, try this:

  • use the Lookup Issues action with JQL to load the other issue's data
  • use the smart values condition to confirm you found one-and-only-one issue
    • first value: {{lookupIssues.size}}
    • condition: equals
    • second value: 1
  • copy the field from the lookup results by typing this in the Edit Issue action for the field, the same as you used to select Proces from the dropdown field list
    • {{lookupIssues.first.customfield_10177}}

 

Finally, for questions like this, I recommend starting with your Jira Site Admin for help.  They will know the context of your site's configuration, your company's business, and thus be able to help faster with rules.

Martin Kovalcik
Contributor
March 19, 2025

I used the Lookup Issues action and the {{lookupIssues.first.customfield_10177}} smart value for copying the value and it works fine, but only when the value of the original field is made up of exactly one of the available options. If it is a combination of two or more options, the rule clears the value of my "target" field so it ends up empty.

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.
March 19, 2025 edited

My mistake as I forgot this was a multiple-select option field, and so JSON must be used with advanced edit.  Please try this, as noted in my first response but now using the lookup results:

{
"fields": {
"customfield_10177": {{lookupIssues.first.customfield_10177.asJsonObjectArray("value")}}
}
}

 

Martin Kovalcik
Contributor
March 20, 2025

excelent

now my rule works exactly as i wanted

many thanks to you Bill

Like • Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events