It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Changelog payload in webhook differs when changes are made in GUI vs API. Edited

Hi,

While debugging our webhook, we've noticed that when a user edits the assignee of a ticket, the to and from fields of the webhook payload's changelog will contain an accountId on JIRA Cloud. However, when assigning a user using the API (/rest/api/latest/issue/<key>/assign) in our tests, we're getting the account name.

For example, this is what we get when editing the assignee in the GUI:

{
"changelog": {
"id": "11218",
"items": [
{
"field": "assignee",
"fieldId": "assignee",
"fieldtype": "jira",
"from": "<user-1-id>",
"fromString": "<user-1-name>",
"tmpFromAccountId": "<user-1-id>",
"tmpToAccountId": "<user-2-id>",
"to": "<user-2-id>",
"toString": "<user-2-name>"
}
]
}
}

And this is what we get when we edit the user via the API:

{
"changelog": {
"id": "11218",
"items": [
{
"field": "assignee",
"fieldId": "assignee",
"fieldtype": "jira",
"from": "<user-1-name>",
"fromString": "<user-1-name>",
"tmpFromAccountId": "<user-1-id>",
"tmpToAccountId": "<user-2-id>",
"to": "<user-2-name>",
"toString": "<user-2-name>"
}
]
}
}

We've looked at the entire payload of the webhook and it does not seem like there's any simple way to differentiate between the two values, aside from using a regular expression matching for an account id (and hoping nobody creates an account that matches it! 😜)

Which leads me to ask the following questions:

- What are tmp*AccountId? They look like they are the accountId for both users, but the use of tmp in front of these values makes me wary of using them. Are they going away? Will they be renamed? If so, to what? I haven't been able to find any documentation about these values.

- Is there a way to force the webhook to always receive accountId's?

- Is there a more obvious way than using a regex to know if the to/from values should be interpreted as the user name or accountId?

- We initially wrote our test using a local server, which can still accept the user's name when assigning an issue. However, according to the JIRA cloud documentation, name should not be a valid parameter anymore, and yet here we are and the assignment works on JIRA Cloud. How is that possible?

JF

PS: We tried updating the assignee using the accountId in our tests as a workaround and that generated also an event with user name instead of accountId, so we're out of luck.

 

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

375 views 1 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you