Hello all,
Could someone please provide a smart value for removing a specific number of characters from the Summary. We prefix our Summary with a date. For example "2023-12-01 - Testing security vulnerability". I need to remove the "2023-12-01 - " prefix if this date is updated to NULL. In short, I'd need to remove first 13 characters from the Summary. I'd greatly appreciate your help.
Hi @Gregory Kremer ~ you can achieve this several different ways.
I'm sure there are more...
Laurie, Shawn,
Unfortunately {{issue.summary.right(11)}} didn't work as expected (sorry I needed to remove first 11 characters, not 13 as initially stated). It left last 11 characters from the right to left, instead of removing first 11 characters. Here is from the test issue History:
Automation for Jira updated the Summary 15 minutes ago
2023-12-15 Testing Please Ignore -> ese ignore
I'd appreciate additional suggestions. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gregory Kremer ~ that's strange. Is the date portion of the Summary being set through some other automation that makes it unavailable when you run this automation? What happens when you try the {{issue.summary.remove("2023-12-01 - ")}} option?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also suspect another automation is prepending the timestamp to the summary.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, the prefix (date) is fluid and would be different for each issue, thus I can't hardcode it. I have another automation in place that places a prefix of that date to the summary on issue creation only. I am positive that that automation wouldn't interfere with the one in question, because this one is being triggered on issue edit only.
So here is what I have in place:
Automation that prefixes a value from a date field (SLA Target Date) to a Summary during an issue creation only, if this field is not empty. This part works as expected.
The automation I need your help would kick in on issue edit, when a date field is cleared by user(s) (Null value). In this case I'd need to remove prefix from the Summary.
There are no more automations in place.
Thank you both for your assistance. I hope you would have additional suggestions.
P.S. Just for the sanity check, I've disabled the "on creation" automation rule. Sorry to say, the {{issue.summary.right(13)}} still leaves 13 characters from the right.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, I figured it out. Needed to use this smart value:
{{issue.summary.substring(13)}} to remove first 13 characters.
Thank you for trying to help. It is always greatly appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gregory Kremer ~ scratching my head trying to figure out why the right(13) isn't working properly. Lets try a different approach:
{{issue.summary.substringAfter(" - ")}}
The above smart value assumes that the format of your Summary is [date] - [summary] so unless you have space dash space (" - ") elsewhere in your Summary it will always returns the text after the first occurrence of the space dash space (" - "). HTH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and...to what Laurie was wondering on the text functions did not work as expected:
Context is important for automation rule questions. To help, please try to post an image of your entire rule, images of the relevant trigger / actions / conditions / branches, and of the audit log details. Those will show what you are describing in the context of the entire rule. Thanks!
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{issue.summary.right(13)}}
This will give you everything in summary after the 13th char.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.