Missed Team ’24? Catch up on announcements here.

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

Automation Rules > Closing Jira Tickets should close Service Desk Ticket

Daniel Ramezani March 9, 2022

How do you setup the reverse of this rule? 
https://community.atlassian.com/t5/Jira-Service-Management/Update-JIRA-ticket-when-closing-Service-Desk/qaq-p/972474

 

Use Case:

Other projects having tickets (epics, features, improvements, etc.) if they get to closed status, then close the Service Desk ticket linked by 'Relates to' relationship.

Please help! I'm really desperate to see if this is possible :)

2 answers

1 vote
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 9, 2022

Hi @Daniel Ramezani and welcome to the community!

"Relates To" linking makes things difficult because you don't have an outbound/inbound link to reference and therefore as other tickets close, the rule can't clearly identify a "parent" (I use the term lightly) to associate.  You need to be able to execute a query where the service desk ticket is differentiated from the other links the issues may have.  Ideally, you want the service desk ticket to see the other issues as something like "Blocked By". 

That stated, you could do something like what I have below to get the job done.  Basically the rule looks to see if there's only one remaining related issue open and assumes that last issue is the service desk issue.  Again, I would stress changing your linking behavior as the best practice for this, but in lieu of that, here's the rule:

2022-03-09_16-31-11.png

 

 

NOTE - This needs to be a GLOBAL rule.  You want to try and limit project scope and/or add conditions to keep this from running rampant on your instance.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 9, 2022

As I posted that answer, I realized that if you never have a use case where two service desk tickets linked to each other, you can use this JQL instead and remove steps 2 and 3:

relatesTO = ((issue}} AND status = Done and issueType != <your service desk issue type>

This would also provide more certainty.  However, this is out the window if you potentially link service desk tickets together.

Daniel Ramezani March 10, 2022

Thanks a lot Mark, I'll give this a try today... 

You're right to assume that service desk tickets will not be linked to other service desk tickets in our organization. 

Basically, we have multiple project sites... one of which is the service desk site. 

If the tickets under those other projects use the 'Relates to' relationship to link to a service desk ticket... then we want closing those tickets to result in closing the service tickets. Hopefully your solution here will work simple enough to accomplish just that :)

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2022

My pleasure.  Based upon the fact that service desk tickets will never be linked to each other, you can accomplish this without the Lookup and Advanced Compare steps then.

Daniel Ramezani March 10, 2022

I couldn't get the result expected unfortunately... 

This is my current setup/result (screenshot A and B) Closing the jira improvement ticket didn't close the SDHELP ticket that was linked. 

I used the status 'Closed' instead because that's our final/final status meaning the ticket is released into PROD. I did notice an error on relatesTO (something about it not existing or not viewable)

[System] Service request (This is what service desk items are, we only use requests, not other types like issues)

Any ideas how to proceed Mark? sorry I'm so new to this...

Daniel Ramezani March 10, 2022

here's the log error: SceenshotC.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2022

Hi @Daniel Ramezani - Sorry the JQL query should be this:

issueRelatesTo = ((issue}} AND status = Closed AND IssueType != "[System] Service Request"
Daniel Ramezani March 10, 2022

....

0 votes
Daniel Ramezani March 10, 2022

Ok issue resolved finally... @Mark Segall thanks for the guidance. I made up a whole another variation of steps and also had to set the 'Closed' status in the service desk project workflow to "Allow all statuses to transition to this one". 

Screenshot 2022-03-10 120618.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2022

I'm glad you got this working.  My approach was working with the assumption that there may be multiple issues linked to your service request ticket.  So the query was supposed to be validating that all issues that weren't your service request ticket were resolved.  Though revisiting it now, I see the flaw in my logic because you'd never branch into the service desk ticket. 

So, if you do need to solve for cases where there are multiple links, you'd want something like my first screenshot, but replacing the branch JQL to:  

IssueRelatesTo = {{issue}} AND Project = SDHelp

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events