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

Automation to find oldest linked ticket

Terry Dance August 27, 2024

I have a process for problem tickets.

Problem stores the date of the oldest linked ticket created date in a field.

When you link a new incident, it checks the created date of that ticket, against the stored date. If the newly linked ticket is "older", then that stored date is replaced by the date in the newly linked ticket. I then have automations that do calculations after that.

What I am stuck on, is if you de-link a ticket, then check the linked tickets for the now "oldest" date and set that as the stored field in the Problem ticket.

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 27, 2024

Hello @Terry Dance 

You can use the Lookup Issues action to execute a JQL to find the tickets linked to the target ticket. Set the JQL to order by Created ASC. That will put the oldest ticket first in the results set.

To access information in that first item use

{{lookupIssues.first.fieldName}}

In that manner you can get the created timestamp of the oldest linked ticket.

Terry Dance August 28, 2024

What value would I put in the for issue key? The smart value isnt working.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2024

Please provide a screen image showing your complete rule. I can't tell you why it isn't working without that information.

This is an example of such a rule. 

Screenshot 2024-08-28 at 10.54.33 AM.png

 

HOWEVER links are considered directional. When you remove a link two issues are affected. This rule will not necessarily be triggered by the issue you are viewing when you remove the link. It will be triggered by the issue that is considered the "source" in the link relationship.

Link Types have an Inward and Outward Description. For example:

link type name  Inward Description  Outward Description 
Blocks  is blocked by  blocks

If the link between two issues is:

ABC-1 blocks ABC-2

ABC-2 is blocked by ABC-1

...then ABC-1 is considered the "source". When viewing ABC-1 you would see "blocks" (the Outward Description) in the Issue Links section, describing its relationship to ABC-2.

So, if you were viewing ABC-2 and removed the link to ABC-1, the rule would actually be triggered for ABC-1.

Terry Dance September 9, 2024

Its all good I used the lookupissues action and ordered them to have the oldest ticket first. I then clear the field that was storing the date of the oldest linked ticket, then input the created date of whatever the now oldest ticket is. Which then kicks off my calculations. So it now works for linking and unlinking.

Like Trudy Claspill likes this
0 votes
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 27, 2024

Hi @Terry Dance,

From your description, it seems as if you already have all in place to go through the issues, lookup the oldest date and update your issue. So I assume your biggest problem is finding the issue that is no longer linked?

There is an automation trigger issue link deleted that you can use to identify the issues on both ends of the removed link. The following smart values identify those issues:

{{issue.key}}
{{destinationIssue.key}}

If you have those, I would assume you could fill the gap in your logic to kick off the calculations you are already able to perform.

Hope this helps!

Terry Dance August 28, 2024

Im just using a Issue Linked trigger, and comparing its createddate to the stored date I have on the automation.

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