Forums

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

Automation to detect change clash

alasdairpa September 15, 2024

Hi all, fist time poster so please be gentle.

I've been asked to figure out an automation so that when a change is raised it will look for any other existing changes where the start/end times overlap and alert the creator, either by comment or email to say, 'clash detected with the following changes, please check', and then list them.  

I've got the logic to find the clashes but the bit I'm struggling with is the comment or email. Because its in a branch anything I do happens on the found tickets not the trigger ticket.

Rule below:

 

Screenshot 2024-09-15 105123.png

 

It is correctly finding the offending issues and logs them, but how can I get that info onto my trigger issue?  or an email. If I use the email option it gives me a email per found issue, when I'd want 1 email with the issues listed, somehow.

Screenshot 2024-09-15 105400.png

 

an yes, I've suggested they use the change calendar  :)

Any suggestion most appreciated,

Al.

1 answer

0 votes
Jack Brickey
Community Champion
September 15, 2024

Hi @alasdairpa , first of all welcome to the community.

What do you mean by "change Clash"? A change to what exactly? 

With the above out-of-the-way, let me simply answer the one question you asked about ensuring that the action occurs on the trigger issue. First I am unsure why a branch would be needed here. I think the approach would be to use Lookup Issues instead. However, you can alway reference the trigger issue using the {{triggerissue}} smart value as well.

alasdairpa September 16, 2024

Hi Jack, thanks for you reply. When I say change I mean as in Change Enablement, but it could be for any type of ticket I guess so sorry if that's just confused things.

I'll take a step back as I'm probably going about this the wrong way.

As I mentioned the requirement is to alert when a new 'Change' issue is created, it should look for any existing issues where the start and end dates overlap, so they can check and move if necessary.

I had originally tried to do it with a look up issues as you say but could not make the JQL work, so I resorted to to what you see above.

I used info here to get the logic for finding where date/times overlap, so the simplest way (assuming that Start is always before End) would be:

(StartA <= EndB) and (EndA >= StartB)

So I ended up with

project = "IT Service Management" and ({{triggerissue.Start Date/Time}} <= {{issue.End Date/Time}}) AND ({{triggerissue.End Date/Time}} >= {{issue.Start Date/Time}})

but it doesn't like where the time component is resolved as it has the '+':

Screenshot 2024-09-16 090747.png

 

So I've tried  {{triggerissue.Start Date/Time.jqlDate.}}    just to see if it will work, although I do need the time component, but can't get that working anyway.

using:

project = "IT Service Management" and ({{triggerissue.Start Date/Time.jqlDate}} <= {{issue.End Date/Time.jqlDate}}) AND ({{triggerissue.End Date/Time.jqlDate}} >= {{issue.Start Date/Time.jqlDate}})

gives:

Screenshot 2024-09-16 091109.png

 

So any suggestions on getting the lookup issues working or any other way of achieving this would be great, thanks again.

Al.

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