Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation using Regex to edit issue and update multiple fields extracted from email description

Habib Memon September 10, 2024

Hi Community,

I am wondering how to do this in a simple way. 

On one of our JSM project, we receive external email which is converted to a ticket.

We want to extract these form like fields in the description to their respective fields in Jira Ticket.

 

 

Hello,
Please be notified that project for 1234 Test St, City, ST, Postal
Code and Unit 6789 has been scheduled to start on MM/DD/YYYY.
 
Group Id : 12385
Unit Building : 6789 - 1234 Test St, City, ST, Postal Code
PROJECT TYPE : 3rd type
Move Date : MM/DD/YYYY
Start Date : MM/DD/YYYY
Ready Date : MM/DD/YYYY
Completion Date: MM/DD/YYYY
Cont Company : Test Building Services Inc.
Pr Project Manager : Tim Logas(tlog@invest.co)

 

Special Instructions: Please ensure this unit is ready for occupied to begin on the indicated start date.

Regards

 

I have made an automation script on issue creation to edit issue fields and update relevant Jira fields (most of those are custom fields) using Regex as shown.

Screenshot 2024-09-10 100919.jpg

I am bit confused whether to select one or more fields from Choose fields to set and remaining in additional fields or I am missing something as got this error in automation audit log.

Error while parsing additional fields. Not valid JSON.

1 answer

0 votes
Jim Knepley - ReleaseTEAM
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 10, 2024

I would need to experiment, but I don't think smart values are quoted strings by default, meaning that you're composing invalid JSON like:

{
    "fields": {
        "customfield_10072": 3rd type
    }
}

 

Maybe try something like:

issue.description.match("^PROJECT TYPE:\s*(.+)\s*$").asJsonString

...and see if that works.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events