Hi Jira Gurus,
I'm working with Jira Automation using Smart Values. I intend to extract a substring that ends with colon ":", hence I am using:
{{issue.summary.substringAfterLast(":")
However, the string does not contain the actual last colon, I wonder if there is a way that can contain it or add it at the end of the substring.
In my last attempt, I tried using Concat function like this:
{{issue.summary.substringAfterLast(":").concat(":")
But the actual result that came out of that was only the colon character : in the issue summary filed.
I need to clone the Issue summary to another ticket based off on certain criteria, but essentially, I need to drop off the last part of the summary that contains the sprint name, which is just right after the ":" colon character.
Any ideas?
Hi @Sebastian Monsalve -- Welcome to the Atlassian Community!
Would please post an example summary that does not work as expected and an image of the rule action using that smart value expression? Those will provide more context for the community to offer better suggestions. Thanks!
Kind regards,
Bill
Sure, I hope this helps:
Summary: [A4 - Team] A4 Training sessions: A4-Sprint 25Q3-3
Action: Clone issue with new Summary as
{{issue.summary.substringAfterLast(":")
Result: [A4 - Team] A4 Training sessions
Desired Result: [A4 - Team] A4 Training sessions:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information, and it appears you are using Jira Data Center version.
First, your smart value expression is missing the closing, double-curly brackets }}
Next, I am a bit confused by what you show as the substringAfterLast() should have returned this:
A4-Sprint 25Q3-3
Did you instead want to use substringBeforeLast?
In that case, please try this:
{{issue.summary.substringBeforeLast(":").concat(":")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Yes you're right, I must had change it to AFTER a moment ago while I was doing some experiments.
But the last case posted there, worked like a charm.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn it is working! Please consider marking this question as "answered" to help others with a similar need find solutions faster. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.