Jira automation rule trigger based on change to smart value field

Katya January 20, 2025

Hello,

 

I’d like to set up a Jira automation rule to be triggered upon a change to issue related scenarios.

If I understand correctly, the smart value for this is {{issue.properties.assertthat-scenarios.total}}.

However, I’m unable to use this field in “Field value changed” trigger, I can only select from the list of the drop down values.

If there is a way to do it, then my second question would be: how can we set up the rule action to display the Acceptance Tests section for issues where {{issue.properties.assertthat-scenarios.total}} > 0 and hide it when {{issue.properties.assertthat-scenarios.total}} == 0?

I found that the Acceptance Tests section can be hidden/exposed using "https://[domain].atlassian.net/rest/api/2/issue/[id]/properties/com.assertthat.jira.bdd_assertthat-bdd-new-issue-left-panel"

(DELETE for hiding or PUT with payload: {“added”:“com.assertthat.jira.bdd_assertthat-bdd-new-issue-left-panel”} for exposing), but I wonder if there is a way to use Jira Automation rules for this purpose.

 

Appreciate your advise.

Katya.

2 answers

1 accepted

1 vote
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.
January 21, 2025

Hi @Katya -- Welcome to the Atlassian Community!

The Issue Updated trigger will not fire for a change to an issue's entity properties, and there is no built-in automation rule trigger for such properties.

As a workaround, a webhook may be used:

Kind regards,
Bill

Katya January 22, 2025

Many thanks @Bill Sheboy the webhook seems to be the answer!

The action that should run based on this trigger is a bit complex and I wonder if Jira automation is even intended to handle such flows:

Determine issue tests presence

Determine Tests section visibility status

if tests present && section invisible {

  expose Tests section

} else if tests not present && section visible

  hide Tests section

}

 

Determine issue tests presence 

curl  -w "%{http_code}" -X GET -H "Content-Type: application/json"  https://[domain].atlassian.net/rest/api/2/issue/[id]/properties/assertthat-scenarios

200 -> present

404 -> not present

 

Determine Tests section visibility status

curl  -w "%{http_code}" -X GET -H "Content-Type: application/json" https://[domain].atlassian.net/rest/api/2/issue/[id]/properties/com.assertthat.jira.bdd_assertthat-bdd-new-issue-left-panel

200 -> visible

404 -> hidden

 

Expose Tests section:

curl  -w "%{http_code}" -X PUT -H "Content-Type: application/json" -d '{"added":"com.assertthat.jira.bdd_assertthat-bdd-new-issue-left-panel"}' https://[domain].atlassian.net/rest/api/2/issue/[id]/properties/com.assertthat.jira.bdd_assertthat-bdd-new-issue-left-panel

 

Hide Tests section:

curl  -w "%{http_code}" -X DELETE -H "Content-Type: application/json" https://[domain].atlassian.net/rest/api/2/issue/[id]/properties/com.assertthat.jira.bdd_assertthat-bdd-new-issue-left-panel

 

I couldn't find any embedded action to get/set the above other than using Jira API and I'm also not quite sure where in the rule I can place the first 2 API calls that determine the condition.

Am I trying to abuse the tool? :)

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.
January 22, 2025

First to your last question: if you are doing something not permitted (or exceeding the service limits or usage limits) for rules, that will likely be detected and the rules halted...perhaps for your entire site!

However, based on what you describe:

  • The Send Web Request action could be used to gather the test information with no problems
  • I am unclear what those last two calls do.  Are they toggling a setting to impact the UX or something else?

 

And to learn more about calling a REST API endpoint from a rule with the Send Web Request action, please see this article:

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

Katya January 26, 2025

@Bill Sheboy 

I am unclear what those last two calls do.  Are they toggling a setting to impact the UX or something else?

Correct, they expand or hide one of the UI sections of an issue.

Many thanks for your help! I'll take it from here.

Like Bill Sheboy likes this
4 votes
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2025

Hey @Katya

welcome to the Atlassian Community.

It looks like the trigger you want to create is not possible. Why? Based on the information you've provided, it looks like the data is stored within an issue property (issue.properties.assertthat-scenarios) instead of an actual field. The Field value changed trigger works afaik only for actual fields.

Having said that, it seems that these properties are added by the AssertThat app. Why don't you reach out to their support and see if they can help you solving your use case?

Cheers,
Matthias.

Katya January 20, 2025

Thank you @Matthias Gaiser _K15t_ 

I contacted AssertThat support with the same question however while waiting for their response I thought that I might get insights about possible workarounds for using issue properties in Field value changed trigger in this community too.

Like Matthias Gaiser _K15t_ likes this
Aaron Pavez _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2025

Hi @Katya 

We cannot use issue property with automation. Automation doesn't have any way to read that for the moment.

You can do something as mentioned here:

https://community.atlassian.com/t5/Jira-questions/jira-automation-accessing-project-properties/qaq-p/2036559

Read the issue property and save it to a variable.

But the rule must be Manual. 

Regards

 

Katya January 20, 2025

Thank you @Aaron Pavez _ServiceRocket_ 

Actually what I'm trying to do is to trigger an update of ANY issue upon a change of {{issue.properties.assertthat-scenarios.total}} of that issue by setting the value of that property to some custom field of the same issue.

I am able to set the property into the custom field by using the Edit issue action, selecting the custom field from the drop down and setting it to {{issue.properties.assertthat-scenarios.total}}. This part works.

What I'm missing is which trigger should be used to fire the rule on an issue when its {{issue.properties.assertthat-scenarios.total}} gets changed.

I read the answers in the link you sent however I'm not sure which of them you suggested to follow.

Also, when you say that the rule must be manual, do you mean that it should be triggered manually for every issue I want to apply it to?

Thank you for clarifying!

Katya.

Suggest an answer

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

Atlassian Community Events