Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×Hi Team,
I am looking for a regex solution to trim the summary of a Jira ticket that is generated from the incoming email handler. Before creating the ticket, I want to extract only the relevant part of the summary and use it as the ticket summary.
The original ticket summary reads: "The following 1 documents have been received from Vendor Company Name:," but I want the summary after ticket creation to simply be "Vendor Company Name" instead of the full line.
NOTE : The company name always changes depending on which vendor we receive the email from.
Hi @Lakshmi CH ,
My name is Sergio, a member of the support team from Decadis. I would like to suggest you an approach using our app Jira Workflow Toolbox.
You would only have to add our "Update fields" post-function, and then update the "Summary" using the following expression in "General" mode:
%{trim(toString(findPattern(%{issue.summary}, "(?<=from).*$")))}
This expression will obtain all the text after the "from" and make a trim as required.
And then, at last, you should only have to add the following expression in the "Conditional execution" section of this post-function:
"have been received from" IN %{issue.summary}
With this configuration, you can automatize this project in the "Create" transition for those projects where you are interested in updating the summary if it has been created by the mail handler you are currently using.
If you have any doubt regarding this approach or you would like to know more about our app, feel free to ask!
Hope you have a nice rest of the week.
Best regards,
Sergio
Hi @Lakshmi CH
I worked on this on my test instance, its working fine for me. Please review the screenshot.
I have done this from summary to description and you can update this accordingly to your requirement.
Reference :
{{issue.summary.replaceAll("^[\\s\\S]*?from\\s*:?\\s*","").replaceAll("\\s*[:,].*$","").trim}} is waiting for document review.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @sai chinamuthevi ,
Its not working in my case. Its still showing full line. should I change anything else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lakshmi CH
Did you try the following:
{{issue.summary.extractRegex("(?i)from\s+(.+):").trim}}
Hope this helps!
Kind Regards
Utkarsh
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.