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:
[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.
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:
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.