Get the value of Location from issue description and send email to the correct team
Asked by sharos_pillai:

Team: Facilities

Location of Workstation: Top Ryde

Is this person a Manager of other staff: No

The above is from the description field in JSM. I want to be able to get the Location information and send an email to the correct team depending on the location. If the location is Top Ryde, then send mail to DL:Top Ryde, if the location is Box Hill, then send mail to DL: Box Hill. If there is no location mentioned, then do not send a mail.

Thanks

SP


Answers:
author: Timothy
body: thanks.[.](https://liteblue.cloud)..


author: Trudy Claspill
body: Hello [@sharos_pillai](/t5/user/viewprofilepage/user-id/5276944)

Is that the only content in the Description field?

Will the prompt text always be in that order?

Could there be any variation in the prompt or response text, such as variations in the case used, spelling, or spacing?

I believe it would be possible to parse the field to pull out the location text, if there is consistency in the prompt text. If there might be variations then it would be more challenging.

What event would trigger the automation rule? Are there additional criteria that should be applied to determine if the rule should run, besides finding the specified text in the location field?

What if the Description field content is changed after the rule runs?

comments: author: sharos_pillai
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/671216) ,  
Employee Details  
First Name: Joe  
Last Name: Joe  
Preferred Name: Joe  
Start Date: 13/08/2024  
Team: Facilities  
Location of Workstation: Top Ryde  
Is this person a Manager of other staff: No  
These are the information in the description field.  
There could be about 5 location of workstations that can be specified, Top Ryde, Box Hill, Dundas, Ermington \& Haymarket.  
The trigger event should be when the issue is created in Jira.  
The rule should only be run when the location has a value and not when location has no value.  
Thanks  
Sharos  


author: Trudy Claspill
body: Is the content of the issue always going to contain all of those prompts in that order? Is the case, spacing, and spelling going to be consistent or might there be variations?

How are these issues being created? Do they come from emails or from use of the JSM Customer Portal? I ask because the automation would be simpler if the Location information was contained in a selection list field instead the Description field.


author: sharos_pillai
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) , the content is going to be always in the same order.

The description will not be changed after the issue is created.

The issues are created by email.

Thanks

Sharos


author: Bill Sheboy
body: Hi [@sharos_pillai](/t5/user/viewprofilepage/user-id/5276944)

I am following up to learn if you solved this one yet to extract the location information from the description field.

If not, have you tried something like this yet to extract the location using [text functions](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/):

```
{{issue.description.split("\n").match("Location of Workstation: (.*)")}}
```

Kind regards,  
Bill