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

How to check if an issue exists in an EPIC and create it if it does not exist

Kaps November 16, 2021

Hi,

I have a manual automation rule that creates a set of issues linked in unique ways between one another when an EPIC is created. I have over time, updated the rule where the latest version of the rule creates additional issues in the EPIC compared to the previous rule versions. I'm now trying to create a rule to check if there are missing issues in existing EPICs that used an older version of the rule, and if so, create the missing issues for the given EPIC to match what the current rule does.

I'm facing two problems

  1. I'm able to add 'For issues in EPIC' branch however, I cannot check in that branch if an issue is missing by checking for a particular summary and if so, create it; basically can't add nested branches

  2. I'm unable to use exact phrase checks for the summary of an issue in any of the SQL conditions; basically, the (\) escape character for quotes doesn't work as mentioned in your documentation for an advanced SQL

 

1 answer

1 accepted

0 votes
Answer accepted
Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2021

For item 1: it would help to have more detail. Consider posting a screenshot of that portion of the rule. Conditional/Branch nesting is a known limitation of Jira Automation. The typical workaround is to "unroll the nesting". In your case, perhaps a JQL-based conditional could check for the missing issue and set a variable. Then refer to that variable later in the branch.

For item 2: exact search in Jira/JQL is not currently supported (despite the documentation).

Refer to JRACLOUD-69263 and please vote for it!

Kaps November 17, 2021

Thanks for the update @Mykenna Cepek .

I did try to paste an image when creating this question however, it didn't work.

Will try to add it again.

Kaps November 17, 2021

Here is a snippet of the rule I have been trying to put together

Jira_Issue.jpg

The idea was to loop through all the issues of the EPIC and set a variable to indicate the issue with a certain summary was not found. Then, later check the variable and if the issue was not found, create the issue and add it to the EPIC

Kaps November 17, 2021

I guess the main thing I need to do is check the summary of the issue but, if exact phrases cannot be checked then I assume that means there is no solution available?

Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 18, 2021

Exact phrases cannot be checked currently, and just today I noticed that the priority of the related JAC issue (linked earlier in this thread) was unfortunately decreased.

However, just because JQL doesn't support it doesn't mean that Jira Automation can't make an exact check -- it can. It'll just take a bit more work in the rule. For example, just add another conditional that checks the specific field name (e.g. Summary) against the text. I think that's what you meant to do instead of the "Issue Matches JQL" conditional shown above.

Another factor that may impact your goal here is that Jira Automation doesn't naturally support an algorithm which loops to update a variable, and then later checks that variable. In short, that just doesn't work, because for performance reasons Automation will execute the loop content in parallel threads, leading to non-deterministic behavior with the variable.

Like Bill Sheboy likes this
Kaps November 18, 2021

Thanks @Mykenna Cepek

It makes sense,

As you suggested earlier, I'm able to get it to work now by using the "If Related Issues Condition" with a JQL that checks for most of the summary name. Still some bits and pieces to do but don't see any major blockers now!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events