Forums

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

Jira Automation: how to link issues mentioned in the description (iterative)?

Dirk Bessell
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 27, 2023

Dear all,

in Jira (Cloud version) we use sub-tasks for client deliveries. The sub-tasks' description contain every task which is included in the respective delivery (release) in the form

[PROJECT-1234] Summary

[PROJECT-1235] Summary

I sure know that there are better ways to do it, but that's not the point here since the client requires us to do so.

I have played around with Jira automation, but am struggling with the following task:

1) Automatically link the issue key PROJECT-XXXX within the description to the respective issue.

2) Automatically link the issue mentioned in the description as "relates to" within the delivery sub-task.

Is there any way to realize this using Jira automation? What would be the approach?

 

Thanks for any help.

1 answer

1 accepted

0 votes
Answer accepted
Rudy Holtkamp
Community Champion
June 27, 2023
  1. Trigger on value changed of a summary
  2. Condition: if subtask
  3. Create a var: e.g. 'parentkey' with smart value: {{issue.summary.match("\[(.*?)\].*)}}
  4. Link issue with relation 'relates to' and where 'trigger issue' is, type {{parentkey}}

That is it.

Dirk Bessell
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 29, 2023

Hi Rudy, thanks a million. I could successfully implement this automation with some minor changes. At least the issues from the description are now linked with the "relates to" relation. Next step would be to also delete links when the respective entry in the description is deleted.

BTW, since we're using RegEx here, can we also use back references?

Rudy Holtkamp
Contributor
June 29, 2023

Good to hear that you resolved it.

The second question is a lot harder.

You need to create update your created automation rule.

Place an if/else condtion.

When the regex is filled, use the previous logic.

If it is not filled, then create a new var oldkey with the same sort regex instead of summary use the {{fieldChange.from}} 

If the regex is filled, then you know that link you need to remove.

Create an advanced branch for {{issue.fields.issuelinks}} (with as smart value ilink).

Then add a condition for {{ilink.outwardIssue.key}} equals oldkey, if that equals you need to remove the link. This can only be done with an API call, see here for the details.

 

Back references: I think so, see https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html 

Suggest an answer

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

Atlassian Community Events