Hello community-
I am so close to completing this automation but am hitting a wall on the final piece.
We get an email from our HR system that generates a Jira ticket. We currently manually fill in the fields of the ticket based on the data in in this email. But I don't want to do that anymore :)
I have successfully set up the rules to parse the body of the email and populate the appropriate fields. This is the body of the email:
Name: Jonathan Doe
Company: Our Company, LLC.
Group: Information Technology
Start Date: 5/1/2023
Supervisor: Benjamin Franklin
Title: Vice President
Location: New York
I parsed every line to populate the relevant fields but I cannot figure out how to populate the Supervisor field. It is a User Picker field (we synch our directory with Azure AD) and will also be the initial assignee of the ticket. I know Jira uses their own Atlassian ID string to reference user accounts so... Is this even possible?
Thanks!
-Ben
Can you get their email address? It might be possible to use that to set the Supervisor?
Cheers,
Simeon.
Simeon beat me to it! We always have an exterior app send the user’s email address. Then that works like a charm.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks both of you for your replies. Alas, our HR system is woefully inadequate. I'll ask if they can add an email address but it was like pulling teeth just getting them to send us an email in the first place. If I import all the users into "Assets" can I do some sort of lookup to there? Or... This would only be about 95% accurate but can I use a regex to create an email from the email that HR provided? Something like: Grab the last name (last word of that line) plus the first initial from the word before, concatenate, and append our domain (@company.com)? I know, it's kludgy, but it's all I've got to work with :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you are only asking for trouble doing that. Either HR wants to be a part of the solution or not. I would escalate that upwards if they don't. There's no reason for that type of siloed behavior in my opinion. I would expend your energy on that versus trying to work around them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I agree with you completely and just reached out to our HR department. Here's hoping they will be amenable.
If they can add the supervisor email then it's straightforward to automatically send the ticket directly to the supervisor. But how do I populate "Supervisor" in the ticket? If I put the email address in the "Supervisor" field, will it automatically pick up the associated user account in my directory? Or will I still need to do some sort of lookup?
Thanks again for your help on this.
-Ben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all. Update: HR has added the supervisor's email address to the notification. Sooo... what now? I've tried translating the email to the Supervisor field, I've tried creating a variable, I've tried just slamming the email into the assignee but can't finalize this last piece. Now the incoming email body looks like this:
Name: Jonathan Doe
Company: Our Company, LLC.
Group: Information Technology
Start Date: 5/1/2023
Supervisor: Benjamin Franklin
Supervisor Email: bfranklin@company.com
Title: Vice President
Location: New York
Best case, I need to populate the supervisor and assignee fields with the associated user but I'll take either or, or maybe even just an eamil-this-issue at this point.
Thanks again all,
-Ben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How have you tried setting the email as the field value?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Trying to. Some of the things I've tried---
I create a smart variable {{userName}} with the email address (which sits between the text "Email: " and "Title" in the email body...
{{description.match("Email: \s(Title*)")}}
And then I try to assign the issue to the variable...
Assign Issue-->Smart value--> {{userName}}
And populate the supervisor field with the variable. {{userName}}
And email the issue... to {{userName}}
But none of these work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you logged out what you're storing the email address as to be certain it is correct?
Setting an email address for the user field should work on the Edit action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have not and that’s(of course) a great idea. I’ll try that and report back. I also noticed I can lookup a user using their email address this way so that leads me to believe the API can definitely do it. One way or this is happening:)
https://my company.atlassian.net/rest/api/3/user/search?query=user@company.com
thanks Simmo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Circling back here. With the help I received here, I got it to work.
Once HR added the hiring manager email address to the notification email, I was able to parse that to create a {{username}} variable. Then I do an API call to pull the associated user account:
https://company.atlassian.net/rest/api/2/user/search?query={{username.urlEncode}}
And it works. The returned account is the hiring manager, which I add as assignee and the ticket goes directly to them. Thanks everyone for your help, especially Simmo.
-Ben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great! Glad you got it working @Benjamin Leidner Simeon is the man!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm looking to do this too. Can you share more details on your final solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark. Sure. It is all done through Automation (Projects / <project name> / Project settings / Automation):
NOTE: In my case, The text of the Supervisor email is between “Email:” and “Title” as above but this depends on the text of the email you receive. Here is a snippet of the email I receive from HR…
Supervisor Email: BFRANKLIN@mycompany.com
Title: Intern
ALSO NOTE: if the supervisor email address is a hyperlink, the automation may choke on the HTML so try to ensure the email is text format or the email address is not a hyperlink.
The next step in the automation is to query Jira cloud for the username of the supervisor, based on the smart variable “username” defined above.
You will need to add a header named “Authorization” with the value of
Basic APIKEYABCDEFG!@#$%^&...
Info on creating an API key may be found here but the API key must be base64 encoded. I use this website to do that. Enter the email address you used to create the API key, a space, then the API key and click to Base64 Encode. The result is what you add in the header above after the word Basic.
The final step in the automation is to Edit the issue fields you want with the API call result. I populate the “New Hire Supervisor” and “Assignee” fields:
And that's it. Hope this helps.
-Ben
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm reasonably new here too and still learning but happy to help. Please click the above to accept my answer. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wait. This was originally my question so Simmo deserves the credit and his answer is accepted as the right one. Apologies, I'm still new here too :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There have been changes since. This is what worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.