Hello
needs some urgent help
I tried everything including Ai
I need to capture the email address of email request from the summary /subject line
look up users in Jira Cloud
and change the reporter to that Portal customer
Do I need to use Assets , or do you have other ways to do it
Action: Create variable
Name: email
Smart value:
{{issue.summary.match("([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})")}}
Condition (Advanced compare):
First value: {{email}}
Operator: does not equal
Second value: (leave blank)
(Optional hardening) Add an Advanced compare to whitelist your domain:
{{email.matches("^[\\w.+-]+@transport\\.nsw\\.gov\\.au$")}}
Action: Lookup objects
Schema: Org Directory
AQL:
objectType = "Directory User" AND "Email address" = "{{email.toLowerCase}}" AND (Active = true OR Active IS EMPTY)
(Use the exact attribute names you created. Quotes are required for names with spaces.)
Condition (Advanced compare):
First value: {{lookupObjects.size}}
Operator: greater than
Second value: 0
Action: Edit issue
Click More options and paste this JSON:
{ "fields": { "reporter": { "accountId": "{{lookupObjects.first.\"Account ID\"}}" } } }
(Note the escaped quotes around Account ID because the attribute has a space.)
Add a New action → Log action (or Add comment) on the Else path:
No Jira user found for {{email}}. Reporter unchanged.
Hi Troy,
As per usual, AI is only half correct. You could use Assets to achieve this, but that would require you having all people (I am deliberately not using the term users here) in an Asset schema, in your example provided by AI that would be Org Directory.
Here you will have an Object Type (OT) with all people in it, in your example that would be Directory User. This OT will then have an attribute containing the Atlassian Account ID, which is what you really want to assign as reporter. This is a valid approach but you will have to have this all set up.
If your sole concern is setting reporter to a value, you don't need the whole Assets setup. In your automation rule (triggered on creation of the ticket):
The webrequest step of your automation should look something like this:
Replace {{object.Email}} with the variable you have parsed the email address to.
This will give you a response and you will find the Account ID here in the response, that you can then use to assign to the reporter field:
{{webResponse.body.first.accountId}}
More info on the webrequest action and automation:
https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Send-web-request
Hope this helps!
What url do I need to use to capture the info from Atlassian ?
so the black out bar is our url
Authorization i= our Api key?
Bit confused
So yes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The GET doesn't work our Government Firewall stops all access to the API call
so that option is out. takes too long to get approvals to open it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Troy,
The auth header is what you would use in for example Postman to do the call: Bearer API token.
Too bad for the GET then, then you are stuck with the option I first described.
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.