Hi all,
Hope someone can help me with my question.
I got a requirement where the service desk tickets: Incidents/Service Requests/Problem, would carry its own issue key. For example an incident ticket will have INC-123; and a service request ticket will have SR-124 and so on. And all tickets in just one project.
I created a custom field to store "INC" or "SR" or "PB" based on issue type. Then I created an automation with IF/ELSE conditions when issue is created. The automation is to add a suffix on the Summary field as "PRJ-123INC-Short summary of incident". Where:
- PRJ is the project key
- 123 is the key sequence number
- INC stands for incident
- and the rest is the text in Summary field.
But the business wanted to have PRJ to be replaced with INC in the Summary field. What will be the smart value to extract the numbers in the issue key and prefix it with the custom field I created? I gone as far as... {{customfield_10221}}-((issue.key}} , but this also takes the PRJ part.
Regards,
Hi, @Zaldy Parian
I think, the best way will be using split function. Key - it's a simple string, that looks like ZZZ-123, where ZZZ is project key, and 123 - index number.
So, if you'll use something, like this:
{{issue.key.split("-").first}} -> ZZZ
{{issue.key.split("-").last}} -> 123
you'll receive demanded values.
Thanks for your help and guidance. This option addresses my inquiry.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use something like - {{issue.summary.replaceAll('([A-Z]+-\\d+)', 'INC-$1')}}
Refer - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay_view26_
Great stuff. thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Take a look at the following link on dealing with text parsing for automation - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/
Hope this helps.
Best, Joseph Chung Yin
Jira/JSM Functional Lead, Global Technology Applications Team
Viasat Inc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your help and guidance. This is also a good option to my inquiry.
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.