Hello Community,
I'm trying to achieve the following -> Link to similar issue
My automation rule looks like:
Everything works like a charm, but the issue comes when one of our users modifies one of the fields Carrier 1 or Carrier 1 TicketID for the second/third/etc. time, the Summary will get duplicated...
This is how it looks if one of our users append for the second or third time the value issue.Carrier 1 Ticket ID:
I see that I can use the substringBefore(), but I really do not understand how should I use it.
My issue it's really the same as the linked one on the top of this question.
If somebody would be kind enough to explain a little like for newbies, I would really appreciate.
Thanks,
MikeSierra
It is exactly as your linked issue solution, it simply means that the Summary content will always strip out the original Carrier 1 and Carrier 1 Ticket ID, and then replace it with the new Carrier 1 and Carrier 1 Ticket ID information.
In other words, it will always create the new Summary content using the original Summary value + the latest Carrier 1 and Carrier 1 Ticket ID information.
Take a look at the smart value help guide link - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#Smartvaluestextfields-substringBefore(Stringseparator)
Hope this helps.
Best, Joseph Chung Yin
Jira/JSM Functional Lead, Global Technology Applications Team
Viasat Inc.
I tried but I didn't know how to use it.
I saw the documentation, but I don't know how to adjust the automation rule in order for it to work..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, right now, this is how the Then: Edit issue fields look like:
How this should be adjusted with the before mentioned String so it works?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It will be something against the Summary field and only get the original summary value -
Example - My original summary value is "Hello", then I appended " *World" to it.
So for me to get the original summary value before appending the new Carrier 1 and Carrier 1 TicketID value, I will use
{{issue.summary.substringBefore("*")}}
In your case will be -
{{issue.summary.substringBefore("*")}} | {{issue.Carrier 1}} | {{issue.Carrier 1 Ticket ID}}
Hope this makes sense.
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've appended the new one that you just told me, and it still gets duplicated:
I've changed 2 times the Carrier 1 Ticket ID, and it got duplicated on the both attempts.
This is how the Edit issue Summar looks like now:
{{issue.summary.substringBefore("*")}} | {{issue.Carrier 1}} | {{issue.Carrier 1 Ticket ID}}
Thanks,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since when you append the fields value, you are using the "|" character, please try substringBefore("|").
My example was stating that I use the "*" appending the original summary value.
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now it strips all the Summary and leaves only the Carrier 1 & Carrier 1 Ticket ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike:
Just make sure I understand the whole picture, please validate if the following is correct -
Initial issue after creation - Summary is "Hello World"
After 1st editing of the custom fields - new Summary value is Hello World | TELNYX | POxxxxxx
After the next editing of the custom fields, new Summary value is not showing as Hello World?
The syntax of
Returns the text before the first occurrence of the given separator.
1
{{issue.summary.substringBefore("W")}} -> Hello
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just created a quick test. Here is the syntax I used in the Edit Summary field action with the trigger event when "Country-City" field value is changed (Only applicable in the Edit Issue operation)
In this case, I don't want this rule to fire when the Country-City field is populated during the Create issue operation.
{{issue.summary.substringBefore("|")}} | {{issue.Country-City.value}} | {{issue.Country-City.child.value}}
In my test case, I have a custom field "Country-City" (cascade dropdown field). Once it is updated during an actual edit issue event, it will grab the value from field and append to the original Summary field value.
So Issue Created initially - Summary is "Hello World"
1st Update of the Country-City field - Summary is now Hello World | USA | San Diego
2nd Update of the Country-City field - Summary is now Hello World | Japan | Osaka
Another thing is a great tool for you to debug your automation rule (especially with smart value test is to write the output to audit log for verification). Here is the reference link on debugging process - https://support.atlassian.com/cloud-automation/docs/debug-an-automation-rule/
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If my suggestions helped you, please remember to click on Accept answer when you have a chance, so others with similar questions can find this post as an answered ask with solutions.
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Joseph Chung Yin I have setup exactly the same flow as you described, now it works, but it still strips the Summary when Carrier 1 Ticket ID gets changed during edit, not on the initial create of the ticket.
I don't know what I'm missing here, or what I'm doing wrong, but....
Here's the ticket history:
So as you can see, the title will go from: P2 | NOC | SUMMARY | TELNYX | PO_929ef5 to P2 | TELNYX | PO_929ef6.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on the audit log activities - Your original Summary value is P2 | NOC | SUMMARY | TELNYX | PO_929ef5, then it got updated to P2 | TELNYX | PO_929ef6, the rule is working.
The substringBefore syntax correctly just retain "P2" and then append the new fields values.
So I don't understand your meaning of SUMMARY is still being stripped off? What is the original summary field value of your issue?
Best, Joseph
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.