Hi i would like some advice on how to extract specific part of text from a comment. I am looking to extract a part of line so i can then paste this into a custom field.
Any advice?
Hi @David Fawkes,
Welcome to Atlassian Community!
You can do that with smart values and automation. The smart values for text fields have lots of options to extract substrings from a field. For example I am using this in one of our automations to find Prisma Alert Ids:
{{issue.description.substringBetween("This was Prisma Alert ",",")}}
Thanks for this suggestion but i cannot get it to pick up the field from the comments.
The text comes in via a comment as below and i want to take the U439090 section and put this in to a field in Jira. The number though will always be different.
..............................
Work Order No: U439090
Origination Date: 06/01/2023
Originator: eng-341
Asset Number: IZC12
Priority: D
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.
So something like this should do it for you assuming that it is the last comment:
{{issue.comments.last.body.substringBetween("Work Order No: ", "Origination")}}
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.