Forums

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

advanced json edit condition with issuelinks not working

ben friedman May 26, 2021

Hi,

the use case is that i would like to update an issue field with some of its *specific* link issue type keys. for example, issue A is blocked by issue B and relates to issue C.

i want an issue field of A to contain the value B but not the value C. 

im using this in the json edit:

{
"fields": {
"customfieldName": "{{#issue.issuelinks}} {{#if{{equals(type.id, 10002)}} {{inwardIssue.key}} {{/}}{{/}}"
}
}

 

i know that 10002 is the correct id that i need. i checked the json view of the issue, and also printed the type.id into the log.

 

however, using the syntax above, it doesnt add the relevant key.

1 answer

3 votes
Manon Soubies-Camy
Community Champion
May 27, 2021

Hi @ben friedman,

Does the following rule meet your needs?

Capture d’écran 2021-05-27 à 09.27.38.png

Looks like it does what you need:

Capture d’écran 2021-05-27 à 09.27.58.png

Hope this helps!

- Manon

ben friedman May 27, 2021

@Manon Soubies-Camy  thanks for the reply, but not quite. 

i need to have that update on all the existing issues in the system that are already linked. 

The trigger cant be for a current linking that takes place. 

I have a manual trigger, that for BRANCH ISSUES: jql for epics + tasks != closed status.

i cant use another branch of linked issues within the original branch and i have to use the original branch to cover the existing issues.

thats why i wanted to use the json approach to pull information into the issue's UI. 

ben friedman May 27, 2021

2021-05-27 22_18_15-Automation rules - Jira.png

Manon Soubies-Camy
Community Champion
May 28, 2021

So would it work if you used a scheduled trigger instead of a manual one? It triggers the rule from a JQL query and then you can add a branch. You also can manually start the rule by clicking on "Run rule". Not sure to understand the functional need behind your question so my suggestion may be irrelevant.

Capture d’écran 2021-05-28 à 14.12.39.png

ben friedman May 29, 2021

actually, the JQL under the scheduled should do the trick i think! 

Thanks :)

ben friedman May 29, 2021

@Manon Soubies-Camy  im actually hitting a problem.

im getting only 1 value on the blocked issue and not a list from all the blocking issues. the blocked issue ends up with 1 blocking issue in the text field. 

in the last action of edit im using ' {{issue.blockers}} {{triggerissue.key}}'

i think that this is since the blocked issue is empty at the beginning and all blocking issues use that instance. i tried to to refetch issue within the FOR, but that didnt help. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events