I've setup an automation in Jira that calls a webhook whenever an item changes status.
Sometimes it reports a change from no status ({{fieldChange.fromString}} comes empty) and the new status is {{fieldChange.toString}} =
StatusBean{self='https://mysite.atlassian.net/rest/api/2/status/10193', description='', iconUrl='https://mysite.atlassian.net/', name='BACKLOG', untranslatedName='null', id=10193, statusCategory=StatusCategory{self='https://mysite.atlassian.net/rest/api/2/statuscategory/2', id=2, key='new', colorName='blue-gray', name='New'}}
the URLs return some meta info about the fields, it seems.
What is this StatusBean? Should I improve the way I parse this, or make my automation ignore it, and how?
Thanks!
The trigger is as simple as this:
The action is a webhook with the following custom data:
{
"key":"{{issue.key}}",
"url": "{{issue.url}}",
"title": "{{issue.summary}}",
"status_to": "{{fieldChange.toString}}",
"status_from": "{{fieldChange.fromString}}"
}
These are the actions that happened at the same time the automation was triggered, although I can't point out exactly when it happened:
This is from the audit log if it helps:
Would you please post an image of your entire rule and of the audit log details showing the rule execution? Those may provide context for what you are observing.
Until we see those...the Status Bean is the component and data/information for the Status field. I would not expect to see those values for the {{fromString}} or {{toString}} as those normally default to the status name attribute. Seeing your entire rule and how you are referencing the {{fieldChange}} may help clarify this.
Kind regards,
Bill
Hi @Bill Sheboy, thanks for replying.
The audit log and the trigger are in my first message. The log shows a successful operation only and no debugging details. These are the screenshots for the additional information about my automation:
Entire automation:
Extra field "updatedInfo" (I use it to track some important updates in tickets):
Action to post to a Slack webhook (will notify a channel):
You assistance is very much appreciated, thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, I got it...Your rule is triggered on Field Updated, for status. And (surprisingly to me) that rule is triggered on new issue creation!
In this edge case, {{fieldChange}} contains the bean as this is moving from "no where" to your backlog (or another status). The hint of this is the "from" is "new". IMHO, this is a defect for the API...but that may be intended behavior for a good reason.
To solve this...What do you want to detect? If you only want to detect an issue status change, please change your trigger to Issue Transitioned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy you are right. I changed the trigger type to When: Issue transitioned and now using the smart values {{changelog.status.fromString}} and {{changelog.status.toString}} to read the old and new status.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.