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

Automation for extracting a URL-link from the description field and populating it to a custom field

Ilari Nikula January 17, 2023

I'm trying to create an automation rule which would copy a URL link from the description field and paste it into a custom field (custom field type: URL field).

Use case: Some of our clients do not use the JSM portal (where we have a dedicated field for inputting 'Instance URL') but prefer to send their requests via email. They typically add a URL-link to the email message which I'd like to extract from the request's description field and then paste it into a custom field (called: Instance URL). Below is an example of a message (read: JSM issue) from which I've been trying to extract the data from:

Description

[Incident description]

 

Instance URL: https://[rest of the URL]

 

BR,

[name here]

 

--



I've tried using smart-values to do this but haven't succeeded. The automation rule which I've created (and which isn't working):

1. When an Issue is created

2. Check if Instance URL field is EMPTY

3. Edit issue fields (Instance URL) -> {{issue.description.substringBetween("*URL: ","")}}

 

For some reason the automation log says the automation works without any issues but the Instance URL -custom field remains empty. I've also tried running the automation rule manually.

 

1 answer

2 votes
Ilari Nikula February 9, 2023

Managed to solve the issue myself with following smart value:

{{issue.description.text.substringBetween("URL: ","[PART OF THE URL WHERE THE SUBSTRING SHOULD END]")}}

Entire automation below:

ExtractURL automation.png

In case the above solution doesn't work for you, e.g. there's a need to extract specific number of characters, following smart value can be used:

{{issue.description.text.match(".*URL: ([0-9].*).*")}}

This smart value extracts the next 0-9 characters after the word URL:

Suggest an answer

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

Atlassian Community Events