Conditional Execution on Linked Issue Validation - JMWE

Ahmad Sidawi
Contributor
June 9, 2022

Hello, 

 

I'm trying to conditionally execute a post function with Jira Workflow Extensions, based on a linked issue of a certain issue type being present.

 

So flow is:

  • Create Issue Post function runs after transition
  • Post function checks if linked issue of issue type X exists
    • If yes, do not run (as post function creates an issue)
    • If no, run (create the issue)

Thanks!

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 9, 2022

Hi @Ahmad Sidawi ,

you can use this Nunjucks expression:

{{issue | linkedIssues(["issuetype"] ) | filter(["fields.issuetype.name","Story"]) | length == 0}}

where "Story" is the issue type name.

Ahmad Sidawi
Contributor
June 10, 2022

@David Fischer you are a legend. Thank you 😊

0 votes
Patricia Vale October 19, 2023

Hi, 

 

And for Data Center, the expression is the same too?

 

Very Thanks

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 19, 2023

No, JMWE for Jira DC uses the Groovy language.  Try something like:

!issue.getLinkedIssues().any{it.get("issuetype").name == "Story"}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events