Editing ticket summary in automation

Dd February 28, 2024

Hi,

I was looking for a way in automation using smart values to change the Summary field as follows:

Say the summary may be in the format below:

"X the actual text of my Summary X"

So basically I have: X<>the actual text of my Summary<>X

I would like to remove X<> and <>X from the summary.

Always the same blank (<>) , always the same character (X here but it could be any single character).

Thanks  

1 answer

1 accepted

0 votes
Answer accepted
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 28, 2024

Hi @Dd 

Without seeing the specifics of your automation rule, I believe what you describe is possible using several different possible text functions: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/

Perhaps review those ones for extracting substrings or using the match() function, and try this in your rule.  I recommend initially writing the results to the audit log rather than updating the Summary until your rule works as expected.

Kind regards,
Bill

Dd March 4, 2024

Hi Bill,

Thanks for the reply. I doubt match() will help (though I might be missing something.

Let me try and describe the situation exactly:

The summary of a ticket is always in the same format:

XY<actual summary>YX

I want my automation to change the summary to be just <actual summary>

So what I'm trying to do is remove XY from the beginning and YX from the end.

If I could use the length() attribute combined with the substring(int start, int end) attribute. combine them and extract something like
summary.substring(2, summary.lrngth()-2) and remove both XY and YX but that didn't work for me (though I might have dome something wrong...

 

BTW - how do u write results in the audit log?

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, 2024

First, you may write to the audit log with the log action: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Log-action

 

Next, from what you described, if the XY and YX text are fixed / in a known format, either the match() function or text functions would work.

For example with the text functions, you may chain them together:

{{issue.summary.substringAfter("XY").substringBeforeLast("YX")}}

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#substringAfter--String-separator-

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#substringBeforeLast-String-separator-

With match, you could similarly write the expression to only return the value in the middle.

 

If you have not already done so, I recommend writing a rule to experiment, writing to the log and adjusting to meet the need.

Dd March 5, 2024

I used the text function - worked like charm (match probably works too - didn't try).

Thanks much! 

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events