What's the best way to configure the webhook to provide accurate reporter details?

Leslie Martin November 15, 2023

We have a cloud instance of Jira Service Management. We are using automation to post a web request to a 3rd party software when tickets are created and edited. Our 3rd party software needs to know the reporter information. 

We had it working using the Reporter.EmailAddress, but that is banking on users making their email addresses visible.

How do we know predictably which Atlassian customer account created any given ticket?

 

2 answers

0 votes
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 16, 2023

Hi @Leslie Martin ,

Welcome to the Community.

Please can you add the answers for the below points:

Leslie Martin November 16, 2023

Hi, Thanks!

Rather than trigger an automation when a ticket is created, we are doing it when a tickets is assigned for the first time only. But the automation needs to contain identifying information about the account that created the ticket. 

 

I'm new, and I hadn't seen Log Actions. That's a good suggestion, but still doesn't provide the necessary information. 

image.png

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 16, 2023

Hey @Leslie Martin ,

Thanks for the update.

Few things I can suggest:

  • Try using the "Validate your web request" Option to see if the API works first
  • I'm assuming you're sending data to another system, does this system accept Jira's issue data format?

I'll check the Jira JSON structure too in the meantime too see the reporter info.

Leslie Martin November 16, 2023
            "reporter": {
                "self": "****************************",
                "name": null,
                "key": null,
                "accountId": "********************",
                "emailAddress": null,
                "avatarUrls": {
                },
                "displayName": "***************",
                "active": true,
                "timeZone": "America/New_York",
                "groups": null,
                "locale": null,
                "accountType": "atlassian"
            },
Leslie Martin November 16, 2023

Yes, my other software accepts the payload correctly. 

When I get it, the emailAddress is null. I have a displayName and accountId. The displayName can be the same for multiple accounts. 

So the account id is possibly the only identifier for a specific account, but my other software doesn't know what accountIds are what, unless we'd do an API call back to Jira for the information. We were hoping to avoid that. 

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 16, 2023

I checked the Jira issue data using this page https://support.atlassian.com/cloud-automation/docs/issue-data-jira-format-payload-for-send-web-request-action/

Here you can see that the email field is available : https://jqplay.org/s/x9ISHc39ua6

I'll try this out in my system to see if I can replicate the behavior mentioned.

In the mean while please try using the Json path shown in the above Jqplay link to reference the creator info too see if that works too.

Leslie Martin November 16, 2023

Thanks for that link to documentation! I was struggling to find good clear documentation. And again thanks for your help so far!

 

So, your examples exhibit the same behavior as I have been seeing. The email field is available, but it is null. In my research that is because the user has the visibility set to hide their email. 

Our original plan was to use the email address as the unique identifier to identify the ticket creator/reporter in our 3rd party database. But that isn't going to work email will likely be null most of the time. 

Which begs the original question....how can I accurately identify the account that submitted the ticket? 

To explain our use case more: Our 3rd party software has all the additional customer information, including street address etc.  We want to receive information from Jira that we can use to query our existing database to get full information about the creator of the ticket. 

Leslie Martin November 16, 2023

One option I was pursuing:

If you set up an animation on ticket creation, the user fields include the account information of the creator. I could do a rule to send the user.emailAddress to a custom field or comment to save it and query it later??

I haven't figured out the syntax for that. 

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 16, 2023

If you use the Validate Web request, does the body contain the email then?

Perhaps you can share the body from one request with the imp info blurred out.

Leslie Martin November 16, 2023

@Jehan Bhathena  yes, the body contains all the info as I expect. But it doesn't have the info I need. 

It doesn't contain anything other than the long account id to uniquely identify the creator of the ticket. The email would be an identifer but its blocked for privacy. 

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2023

Hi @Leslie Martin ,

You're right the email is marked as null at my end too.

What you can do is extract the UUID and pass it as a input to this API : https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get.

The output from this API can then be passed back to your system.

To extract values from the webRequest you can use this Smart Value to get the JSON content: {{webResponse.body}}, another post that might be helpful for reference https://community.atlassian.com/t5/Jira-Software-questions/Automation-How-retrieve-data-in-quot-Send-web-request-quot/qaq-p/2153217#M221473

Do let us know if this works for your use case.

Leslie Martin November 17, 2023

Hi @Jehan Bhathena ,

Thanks so much for your continued answers. We will check into these options. Thanks!

Like Jehan Bhathena likes this
Leslie Martin November 17, 2023

Although, it says this.

Get user



Returns a user.

Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that the user's email address is hidden. See the Profile visibility overview for more details.


I suspect the API response may not be the same as the webhook body. 

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2023

Hey @Leslie Martin ,

The Api response won't be the same, that is why you'll need to extract the value that you need and then pipe it as a individual variable to your webhook. The other alternative that I can think of is, to use the users Uid and fire a curl command in your destination machine that fetches the User ID there itself and use that in the content there.

🙂 Hope this helps.

API response may not be the same as the webhook body.

0 votes
Leslie Martin November 16, 2023

The User fields include the email address upon creation of a ticket. But our webhook only fires when the rule is assigned for the first time. At that point, it does not provide the user information of the creator or reporter.

Our use case is querying for additional contact information in our 3rd party software. But Jira provides us with no customer identifier, other then the name, of which we can have duplicates. 

I see the account id, but for that to work, we would need to add all those id's to our 3rd party database. 

I hope someone can help. I haven't found good documentation on these payloads. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events