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

Comment on linked issues (not the issues in the release) when a Version is Released

Tyler Monroe
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!
July 10, 2024

I'm struggling to figure out if this is possible.

Here's the scenario: When a ticket comes into the service desk project, we link that ticket to another ticket in the actual engineering project where the work is executed (simply using the linked - "relates to" relationship).

Right now when we fix bugs related to those service desk issues in a release, someone has to go back to the service desk tickets and comment in them to the effect of "this was fixed in version xyz", so the service desk team knows they can close out the issue and/or let the customer know.

So I'm trying to build an automation that does the following:

When a version is released, look through all the tickets that are part of that release, then comment on any tickets LINKED to those (NOT comment on the tickets in the release itself). This feels like it should be simple, but I'm having trouble with the logic to make it happen.

Thanks in advance for any help you can provide.

2 answers

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
July 10, 2024

Hi @Tyler Monroe -- Welcome to the Atlassian Community!

Which version of Jira are you using: Cloud, Server, or Data Center?

The different versions have different automation capabilities, so knowing the version will help to focus any suggestions.

 

For now, I will assume Jira Cloud or Data Center...

First, your rule will need to be multiple-project or global in scope because it is trying to access / edit issues in a different project.  Your Jira Site Admin will need to help create such a rule (or change the scope of your rule).

 

Next, this would be easy to solve if automation rules supported nested branching, but they do not.  And so a workaround is needed to get those linked issues: using Lookup Issues as a go-between.

  • action: lookup issues, use JQL to get the issues in the released version
  • branch on JQL: using the results of the lookup to find the service project's linked issues, based on the project and link types
    • action: add your comment to the relevant issue

That branch on JQL may need to use dynamically-generated JQL from the lookup.  For example...

project = yourServiceProject AND 
(
{{#lookupIssues}}
issue IN linkedIssues({{key}}, "relates to") {{^last}} OR {{/}}
{{/}}
)

How that works...

Please check the link types / direction to confirm they match your needs.

Kind regards,
Bill

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2024

Gah, @Bill Sheboy you beat me again!

Great job asking if @Tyler Monroe might be on Data Center. If so, then he might have access to the ScriptRunner JQL Functions that I mentioned that could make this much easier.

But as I mentioned, you and John already solved this for Cloud w/o access to ScriptRunner functions.

Like Bill Sheboy likes this
Bill Sheboy
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.
July 10, 2024

Yes, and...I neglected to add the dynamic JQL in that prior question's response, so I added it this time :^)

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2024

OH man, dynamically generated JQL. I didn't think about that.

I thought you could just iterate through each issue from the original lookup, but augh, yeah, I guess that'd require another branch, which is a no-go.

Bill Sheboy
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.
July 10, 2024

With Jira Cloud, (I believe) the issuelinks smart value could be parsed with smart value, list filtering to get the needed ones in one step.  But that smart value does not exist yet for Data Center's version of Lookup Issues. The dynamic JQL should work for both Jira versions.

Tyler Monroe
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!
July 11, 2024

Thanks gents - this is a little more complex than I was hoping it would be, but at least it'll get the job done!

1 vote
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2024

Heya @Tyler Monroe yes, this definitely should be do-able, although... it'd be a lot easier with ScriptRunner JQL Functions, which would let you do something like: 

project = SDP and issueFunction in linkedIssuesOf("project=CD and fixVersion={{version}}")

(Although argh, because of changes in Cloud I don't think this is possible :-{)

But since we probably can't do that, you'll need to do Advanced Branching. Luckily @John Funk and @Bill Sheboy already answered a similar question to this, which saves me some time:

Let us know if that solves things for you!

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2024

BTW, I cribbed that JQL from this article:

Which links to this great thread about using the ScriptRunner functions to search for specific linked issues:

But again, the huge caveat is that you would only be able to do this if you are on Data Center and have ScriptRunner, because Adaptavist (ScriptRunner's vendor) is not able to make those functions available in "regular" JQL queries, such as the ones that Automation uses.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events