Dear community,
How can I create a variable as part of an automation with T20250611.0010 from a comment like this:
Der Status Ihres Tickets hat sich geändert auf: Zugewiesen
Gerne können Sie den Verlauf Ihres Tickets in unserer Kundenzone auch selbst überprüfen. Klicken Sie schnell und einfach auf folgenden Link, um direkt auf die Kundenzone zuzugreifen: T20250611.0010. Falls Sie nicht über einen Zugang zum Kundenportal verfügen, diese aber gerne nutzen würden, kontaktieren Sie uns.
Mit freundlichen Grüßen,
With {{comment.body.match("zuzugreifen:\\s*(T\\d{8}\\.\\d{4})<").get(0)}} the log is empty.
Thanks for help!
Hey @KLINGER Servicedesk ,
Please try
{{issue.comment.body.match("(T\d{8}\.\d{4})")}}
I also had a little trouble with escaping and brackets, but this one finally returned the desired result for me, given your example comment.
Edit, since this has resolved the initial request:
The working query in this scenario (being robust against multiple entries):
{{issue.comments.last.body.match("(T\d{8}\.\d{4})")}}
Regards from Koblenz/Germany
Thorsten
Hi Thorsten,
Thanks for your input.
I created a log and its still empty. :-(
Greetings from Vienna!
Bernd
I already asked Google Gemine, Deep Seek and ChatGPT. Every answer was looking fine, but didn´t work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Bernd,
We might be able to narrow down your problem if I learn more about the specific usage. As you can see below, using the expression provided within an Add comment action works (even for multiple matches):
What action are you trying to use and how should the result look like?
Regards,
Thorsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thorsten,
this email comes from our supplier. And I want to extract their ticket ID (T20250611.0015) and populate it in our Jira field "External Ticket ID". Therefore I created an automation which shall do this. I tried to access the email body directly and to create a variable with the email body. And in the automation I created logs for every step. The log for the email body is working. But whatever I do the log for the "External Ticket ID" is always empty (see attachment).
Finally I want to have our custom field "External Ticket ID" populated with the ticket ID from each email.
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.
Not Working!
{{comment.body.match("zuzugreifen:\\s*(T\\d{8}\\.\\d{4})<").get(0)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not working!
{{VarLatestComment.match(".*zuzugreifen:\\s*(T\\d{8}\\.\\d{4})<.*").get(0)}}
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.
What custom field type is your 'External Ticket ID'?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Assuming it's 'Short text (plain text only)', the following configuration works fine for me:
{{issue.comments.last.body.match("(T\d{8}\.\d{4})")}}
Please note the slightly different expression needed to have a single value returned.
The result looks like this:
I'm sure we're not far from the solution. 😊
Regards,
Thorsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thorsten, thxs its working but I cant see the "slightly different" you have mentioned and I would like to understand why it was NOT working before. If you need some information about scrum master- or pmi certification you can contact me. ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're more than welcome. Glad to hear it's working now. The following screenshot illustrates the difference in the results. The "slightly" was referring to the usage of "comments.last" (mark the "s") vs. "comment":
So, while the first expression evaluates the comment section as a whole, it seems like the latter version is needed to easily point to a single comment.
Regards,
Thorsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see that two answers are accepted. Can you please provide the pending query so that I can escalate it through a support ticket for our experts to address this?
Regards,
Anusha A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anusha, this query is working:
{{issue.comments.last.body.match("(T\d{8}\.\d{4})")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Technically I "Create variable" with the respective smart value (which should deliver the external ticket ID")
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.