Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Parse Description for Jira Automations

Ryan September 1, 2021

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.

  • Remove all text before <<<START REQUEST>>> and after <<<END REQUEST>>> from the Description Field.
  • Set the Reporter to the email specified after "Person to Notify:" and before the next ","
  • Replace all ","'s with line breaks

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

2 answers

1 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 1, 2021

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

Ryan September 2, 2021

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

Like Bill Sheboy likes this
1 vote
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 1, 2021

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

Ryan September 2, 2021

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

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

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 now
AUG Leaders

Atlassian Community Events