Hello,
I am trying to make some edits via Jira automations by parsing text from the Description Field. Please see the raw output from the form that is generated in the Description Field of the Jira Ticket below.
* External Email - Caution *
A Softphone Request form was submitted with the following details: <<<START REQUEST>>>”ABC ID #: 555555, Username: CH555555, Person to Notify: firstname.lastname@subdomain.domain.edu, Phone Extension: +1 (555) 123-5515, Department Name: DEPT - Department Name, Primary Desk Location: 1234 - TEST, Asset Tag Number: LAPW10G12345, Existing Call Center Agent: No, Agent Extension: <<<END REQUEST>>>
ID: [some ID] | [1]Unsubscribe
Powered by Smartsheet Inc. | [2]Privacy Policy | [3]Report Abuse/Spam‑‒‒‒——–‑‒‑——‒–‒‑‐‐‐‒
----------------------------------------------------------------------------------------
[1] [some URL link]
[2] [some URL link]
[3] [some URL link]
I am trying to fulfill the following actions via project automations.
I'm not sure how difficult this is considering I don't have a lot of experience with Jira JQuery's. If anyone can help me write the queries or point me in the direction of good training material or tutorial videos I would be very appreciative.
Thank you in advance for your time and assistance. Have a great day.
-RP
Hi @Ryan
Are you using Jira Server/Data Center? And if so, which version of Automation for Jira do you have: the free/Lite or paid/Pro version? The version you have may put some limits on what is possible. If you are instead using Jira Cloud, the steps below can be made simpler by using the Create Variable action...but Server doesn't have that one.
To do what you ask, you may use the text parsing functions, supplemented by regular expressions. Here are a couple of references to get you started:
Basically, you may use functions like substringBefore() and substringAfter() to solve your first step, regular expressions with matching for the getting the reporter, and replaceAll() for the last one.
You do not state this, but I am guessing you want to put the cleaned-up results back into the Description field. If so, you may want to do that step first, use a re-fetch action to reload the issue, and then extract the reporter. Please consider posting an image of your rule if you have issues and the community can offer ideas to help.
Best regards,
Bill
Hi Bill,
We are using Jira Data Center Pro/Enterprise version.
Thank you so much for your details & references. Yes, the plan is to put the cleaned-up description & reporter into a new case in a different project utilizing workflow automation.
I am going to try your functions & I will send you a screenshot of the rule & the results.
Thank you very much for your time and assistance. Have a great day.
-RP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ryan
It will be difficult to do all this text processing with just automations.
You can use regular expression in your if condition's advanced compare condition. There is a condition called "contains regular expression".
Then you can access your necessary text using a smart value + regular expression.
{{issue.description.match(".*(lo).*")}}
Details here: https://support.atlassian.com/jira-software-cloud/docs/smart-values-text-fields/#Smartvaluestextfields-match--
For assigning it to a user you will need to get account id of the user.
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ravi,
Per your recommendation, would the correct syntax be the following to pull the email address from my example above?
{{issue.description.match("Person to Notify:.*(lo).*, ")}}
Thank you very much for your time and assistance. Have a great day.
-RP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.
Register nowOnline 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.