I'm trying to automatically close tickets that have two matching values in Description

Taylor Dean April 8, 2024

Hello,

We have automated tickets where the description looks like this:

 

Current Location: Corporate HQ 
New Location: Corporate HQ

Business Process: Lateral Move: Dean James
Subject: Branch Manager - Corporate HQ (Sheldon Stevens)
Details: Lateral Move (Lateral Move > Lateral Move > Move to Another Position on My Team) for Dean James effective on 04/07/2024

 

I want to automatically close any tickets where Current and New Locations are the same while keeping any open where they are not the same.

 

I thought I was close with the following:

 

JIRA TEST.png


I've taken care to perfectly match the spaces here (i.e. one space before "New Location"

When this rule is on it is closing every ticket that comes through (with "Job Change" in the title as per my first IF).

Can anyone tell me where I'm going wrong?

1 answer

1 accepted

2 votes
Answer accepted
Kalyan Sattaluri
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.
April 8, 2024

Hello @Taylor Dean 

Please check @Bill Sheboy 's answer on how to do this here:

https://community.atlassian.com/t5/Jira-Software-questions/Re-is-there-a-way-to-select-a-string-between-a-string-an/qaq-p/1955792/comment-id/775538#M775538

Basically you compare:

{{issue.description.split("\n").match("Current Location:(.*)").trim()}}

equals

{{issue.description.split("\n").match("New Location:(.*)").trim()}}

Hope it helps. 

Taylor Dean April 8, 2024

Thank you so much for your quick reply!

 

I'm very close. I think the last problem I'm running into is that there is a space after the value on "Current Location" but not on "New Location".

If that shouldn't matter with this value, then I'm not sure why it's not working.

Kalyan Sattaluri
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.
April 8, 2024

Hmm. He is doing trim() on the extract...

Instead of doing "equals" check, do a "contains" check. Maybe thats what is throwing comparison off.

Kalyan Sattaluri
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.
April 8, 2024

So, I just tested with the text you posted and contains did work.. Please share if issues.

image.pngimage.png

Taylor Dean April 8, 2024

Yes!

It looks like that has worked.

 

Thank you so much!

Kalyan Sattaluri
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.
April 8, 2024

Great, please consider accepting answer so folks in the future can benefit from the discussion.

Also please upvote Bill's answer in other thread so it getter visibility in search rankings as that was the actual solution.. Thanks!

Like Kai Becker likes this
Taylor Dean April 9, 2024

I've done so. Thank you again!

Like Kalyan Sattaluri likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events