Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation for Status change shows "StatusBean" as transition

Paulo Amaral August 24, 2023

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:

Screenshot 2023-08-24 at 13.37.54.png

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:

Screenshot 2023-08-24 at 13.39.18.png

This is from the audit log if it helps:


Screenshot 2023-08-24 at 13.40.33.png

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2023

Hi @Paulo Amaral 

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

Paulo Amaral August 24, 2023

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:

Screenshot 2023-08-25 at 00.06.38.png

Extra field "updatedInfo" (I use it to track some important updates in tickets):

Screenshot 2023-08-25 at 00.08.38.png

Action to post to a Slack webhook (will notify a channel):

Screenshot 2023-08-25 at 00.09.04.png

 

You assistance is very much appreciated, thanks!

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2023

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.

Paulo Amaral August 25, 2023

@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!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events