Access Jira linked issues in a JSM automation

Nancy Tinder February 25, 2025

I have JSM Incident issues that are cloned and the clone moved to another JS project. I am trying to create an automation that is scheduled for 2-3 times a day to run through all open JSM Incident issues, look at the linked issue in JS and close the JSM issue if the JS issue is Done. 

I grab the JSM list from the scheduled step with JQL, then step through the list with a For Loop step. I was hoping that it would grab the linked JS issue where I could test it and transition the JSM issue to Resolved if the JS link is Done. In the log, it never finds issues other than in the JSM project and the "make sure this works" button in the Linked Issues step brings back tons of records where I had hoped it would bring back just one.

Is this possible to do from within JSM? I am trying not to have to build automations on the JS side as there are several projects and they create new ones all the time so would be a nightmare to keep up with.

I have made it work looking at sub-tasks from within the same JSM project (close the issue if all sub-tasks are closed), but that template doesn't work across JSM and JS projects.

2 answers

0 votes
Nancy Tinder March 3, 2025

I am a Jira Site Admin. I did go out and find where I can change that in the automation and did update it to running on two projects (JSM Sandbox and ITSM - my reg work Jira Project). Still doesn't work as I envisioned. Was hoping for each ITSDS Open Incident issue, if all cloned/relates to records connected to that ticket are closed then close the ITSDS ticket. Trying to automate so my agents don't have to close records in two places. 

Full view of Automation

Full view of automation.jpg

JQL query in scheduled step

JQL query in the Scheduled step.jpg

Rule details

Rule Details.jpg

full JQL query from scheduled step

project in ("ITSDS", "ITSM") and status in ("In Progress", "Open", "Pending", "Reopened") and type = "[System] Incident"

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.
March 3, 2025

Thanks for that information, @Nancy Tinder  Please try to stay within the same thread when responding.  That will help people reading this question in the future know if there are multiple possible solutions.  Thanks!

 

Your scenario seems to be this:

GIVEN there are open JSM incidents in the service project
AND an incident has linked issues in a software project
AND the linked issues to each incident are all done
WHEN it is the first day of the month
THEN transition the JSM incident to Resolved

If that is the case, the rule trigger's JQL should only check the JSM incidents.  The later Related Issues Condition will check if the software project's issues are all done.

  • trigger: scheduled to find the JSM incidents which are not done and which have linked issues
  • related issues condition to check the software issues are all done
    • related issues: linked issues
    • link types: clones, relates to, is cloned by (Please confirm these link types with some example issues as links have direction.)
    • condition: None match specified JQL
    • JQL:  project = yourSoftwareProject AND statusCategory IN ("To Do", "In Progress")
  • action: transition the issue

 

The JQL for that condition is inverted to confirm that there are no issues either in "To Do" or "In Progress" status categories.

 

Nancy Tinder March 3, 2025

Thank you so much for the guidance! I wasn't thinking about restricting to just those with links, but that makes sense. I have made the changes and it looks like preliminary testing is working. If I wanted to open this to more projects, do I need to add them all and maintain the list in that links step? My hope is to set this to run and not have to mess with it. I won't know when new projects are created that may need to be included.

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.
March 4, 2025

In the related issues condition, you could try inverting the JQL to exclude the JSM project:

project != yourJSMProject ...

As that condition starts by checking the linked issues to a triggered JSM project issue, this would find any other issues in different projects.

And, the rule scope will need to change from multiple-project to global.  Confirm your rule trigger's JQL is only checking the JSM project issues before making that change.

 

0 votes
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.
February 25, 2025

Hi @Nancy Tinder -- Welcome to the Atlassian Community!

Short answer: the likely cause is the rule is using single-project scope (in the details at the top) and so cannot see the other issues.  Please work with your Jira Site Admin to update the rule's scope with the global admin permissions.

If that does not help, context is important for the community to help.  Please post the following:

  • an image of your complete automation rule in a single image for continuity,
  • an image of the rule details at the top of the rule,
  • images of any relevant actions / conditions / branches,
  • an image of the audit log details showing the rule execution (with all the areas expanded), and
  • explain what is not working as expected and why you believe that to be the case.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events