Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Fetching custom field value from another ticket

Utkarsh.Jaiswal May 2, 2021

Hi,

I'm trying to edit a custom field value in a ticket through Jira Automation. As a result I want custom field value to be same as a value of another custom field in some other ticket.

can something like this work:

{
"fields": {
"customfield_10356": "{{issue.KEY-123.customfield_10269.value}}"
}
}

If not, what could be the solution. I would prefer a solution without buying Jira addon.

Thanks in advance for any help.

1 answer

0 votes
Ravi Sagar _Sparxsys_
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.
May 2, 2021

Hi @Utkarsh.Jaiswal 

If those issues are linked to each other then I believe you can use the branch rule with linked issue. You can then save the value in a variable which you can later reuse in the rule. Or try {{triggerIssue.customfield_10269}} to get the value. I am quite sure one of these method should work.

Utkarsh.Jaiswal May 3, 2021

Hi @Ravi Sagar _Sparxsys_ 

Thanks for your reply, but the two issues are not related / linked in any way. I'm here referring to two independent issues. I believe both of your suggestions work only for linked issues.

Ravi Sagar _Sparxsys_
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.
May 3, 2021

Yes you need to use links for this to work. You can't use smart values to fetch values of issues by using hard coded issue keys.

However if are not using the issue links then another solution would be to make a web request using Automation. In response to a web request you will get a json data containing that issue's data which you can use in your rule using a smart value {{webhookResponse}}

I have explained how to make REST calls here if you want to take that route but I still think using issue links will be much simpler and easy to maintain solution.

While I was write I realised that you can also use branch rule to run JQL based on that issue key and use a variable to store the value, basically you need some way to reach that issue to fetch its fields.

I hope it helps.

Ravi

Like Utkarsh.Jaiswal likes this
Utkarsh.Jaiswal May 4, 2021

Thanks Ravi! You are right. I needed to create that link to get the values from another ticket. Your advise helped me to find the solution. I used 'Lookup Issues' to get the ticket using JQL query. I could then fetch the details (summary) using below Json:
{{#lookupIssues}}
{{summary}}
{{/}}

However, there is a limitation as we can only fetch limited fields value. For example, custom fields value cannot be fetched.

https://support.atlassian.com/jira-software-cloud/docs/automation-actions/#Automationactions-Lookupissues

Sindhu September 25, 2023

@Utkarsh.Jaiswal can you show the automation screen shot you used.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events