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

Converting full name to user id for use in reporter field

Marius Skoglund
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.
July 21, 2022

Hello. I am quite new to Jira automation, so excuse my limited knowledge.

I am setting up automation for our new hire tickets. These are created from emails sent from our HR tool. I am setting up automation that will set the new hire's Line Manager as the Reporter.

Since the description is just text in an email, I need to do a match for the name, however, the reporter field will not work with full names, and expects userid, username or email, as far as I can gather.

Is there some way for the automation to do a search for full names and tie it in with userid, so this can be populated in the Reporter field?

Using the match command seems to work, but the automation rule gives an error saying the user does not exist, even though the Name is unique and a 100% match of the users Display Name.

This is the info included in the Description from the email.

 An employee has been hired.

Employee Id: 12345
First name: Firstname
Last name: Lastname
Organizational Relationship: Employee
Department: 123456 Sales Europe
Location: Amsterdam, The Netherlands
Reports to: ManagerName ManagerSurname 
Hire date: 2022 09 01

I have tried using this code, but the user picker does not like it.

{{issue.description.match("Reports to:\s(.*)")}}

I assume this has to be done in a few steps, but is this even possible?

Thank you for reading.

2 answers

2 accepted

0 votes
Answer accepted
Marius Skoglund
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.
May 19, 2023

I want to update this post with a resolution.

The solution was to use the app "Email this issue" which we luckily had installed.

By setting Field rules as shown below, I can now auto populate the Reporter field from the incoming email body text.

Screenshot 2023-05-19 092054.png

0 votes
Answer accepted
Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2022

Hi @Marius Skoglund 

To performed something like this, you will need to split the pattern that you got from this

{{issue.description.match("Reports to:\s(.*)")}}

To this

{{{{issue.description.match("Reports to:\s(.*)").split(" ").last}}}}

Or if you want you can create variables in automation to deal with the values more easier.

I assumed the pattern being "FullName Username"

Captura de tela 2022-07-25 230122.png

Then assignee the value that you need with the functions to treat your text.

 Captura de tela 2022-07-25 230337.png

I hope I helped you.

If this post was helpful, mark it as Accepted Accepted, so you can help others who may have the same difficulties.

If your question has not been resolved, please post again with more details.

Marius Skoglund
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.
July 26, 2022

Thank you for the response. The reporter field does still not like the output, this is from the log:

 

Error editing issues
ITOFC-17 (The reporter specified is not a user. (reporter))
Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 1, 2022

@Marius Skoglund does managerSuername have any active users?
You can test with a user like yours for testing purposes.

Marius Skoglund
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.
August 1, 2022

Thanks. Yes, all Managers are active users in the system, and are manually set as reporter for the tickets. Manually, it works, but with the automation, it fails, even though the name matches the users display name.

Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 10, 2022

@Marius Skoglund , is there any log of error of automation ?

If manually, it works, maybe schedule can trigger corectly.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events