Automation Rule: Smart Values Not Working for Issue Type Change

Sid007 August 26, 2024

 

 

I'm facing an issue with a Jira Automation rule that's intended to trigger when an issue's type changes from "Bug" to "Related Bug." However, the automation isn't functioning as expected, and I'm encountering multiple issues:

  1. Smart Values Not Working: The automation rule uses smart values to check the previous issue type ({{fieldChange.fromString}}). This smart value condition is supposed to match when the issue type changes from "Related Bug" To "Bug". However, the rule fails to recognize this condition, even though it appears correct.

  2. Issue Type Change Not Triggering: Despite configuring the rule to trigger on changes to the issue type field, the automation rule does not trigger when I convert an issue type from "Bug" to "Related Bug." This is blocking the execution of the rest of the automation steps.

Here’s a breakdown of the rule:

  • Trigger: Value changes for the issue type field.
  • Condition:
    • The smart value {{fieldChange.fromString}} is expected to equal "Bug".
  • Action: Send an email notification when the condition is met.

I have verified that the issue type change is correctly happening from "Bug" to "Related Bug" on the issues, but the rule is not being triggered or logging the correct smart value in the audit log.

 

Questions:

  1. Is there a known issue with using smart values like {{fieldChange.fromString}} for the issue type field in automation rules?
  2. Are there any workarounds or alternative approaches to reliably detect when an issue type changes from "Bug" to "Related Bug"?
  3. Could the problem be related to how the issue type field is handled in automation rules, especially when it’s a custom field?

Any insights or suggestions on resolving this would be greatly appreciated!

Screenshot 2024-08-26 193122.png

2 answers

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 26, 2024

Hello @Sid007 

Welcome to the Atlassian community.

Whenever requesting help with an Automation rule please provide the following:

  • screen images showing the entire rule
  • screen images showing details of each step that is not working as you expect, and any step that it depends on
  • the output for the rule execution from the Audit Log.

Sometimes the location of the step within the rule is the cause of the problem. Other times there might be a typographical error. These can be determined only if we can see the rule.

I have these additional question:

1. What are the exact steps you are taking to "convert" the issue to a different type?

2. Is more than one field being changed during the conversion process? If multiple fields are changed within the process then the Field Value Changed trigger may not be triggered.

3. You asked if there could be a problem related to the "issue type" field being a custom field. There is a built-in field named Issue Type. Have you created a custom field with the exact same name? That could definitely cause a problem with Automation, depending on which one you are actually changing in the issue and which one you have selected in the Rule.

Sid007 August 28, 2024

Other things are working fine and tested: Just that I cannot get the smart value to work. Tried multiple attempts on doing it as: 

{{changelog.issuetype.from}} equals id

{{changelog.issuetype.fromString}} string equals "Related Bug"

{{fieldChange.fromString}}

etc- but doesn't work for me.(As you see in the screenshot)

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2024

Hello @Sid007 

There is no known issue with using {{fieldChange.fromString}} in a smart value condition. It works fine for me comparing such a value.

Your screen image does not provide any evidence that the condition does not work. That is why I asked if you would please provide both a screen image of your entire rule and the output for the rule execution log as supporting evidence.

 

You mentioned that the issue type change is not triggering the rule. I asked:

1. What are the exact steps you are taking to "convert" the issue to a different type?

I asked this because if you are using the Convert to Sub-task function or the Convert to Issue function, those indeed will not be recognized by Automation as a change to the Issue Type field and the rule will not be triggered.

 

There are reasons for the questions we ask. The information we request helps us debug your issue. Providing the requested information will enable us to get to the root cause faster.

Sid007 August 28, 2024

Yes, I'm using the Convert to Issue option since the issuetype changes from Subtask to a Bug. Maybe that is why the automation is not picking it up. Any way it can be set as such?

Right now it looks like this since I'm trying to use it from: {{issue.changelog.isssuetype.fromString}}

but Audit log says:

Advanced branching
The provided smart value was unable to be resolved to an object.


image.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2024

According to the documentation for change log

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

...the correct method for accessing the smart value for changelog is:

{{changelog...

Not

{{issue.changelog....

 

Also check out the example provided in that document for accessing the fromString attribute. The syntax is different than what you have.

Sid007 August 29, 2024

I have tried these all:
Conditions
{{fieldChange.fromString}} equals Related Bug
Or
{{issue.changelog.issuetype.fromString}} equals Related Bug
Or
{{changelog.issuetype.from}} equals 10000
Or
{{issue.changelog.issuetype.from}} equals 10000
Or
{{changelog.issuetype.from}} equals 10000
Or
{{changelog.issuetype.fromString}} equals Related Bug

None worked.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 29, 2024

It does not appear that you observed this suggestion that I included.

Also check out the example provided in that document for accessing the fromString attribute. The syntax is different than what you have.

Because your list of things you tried does not include the information from the documented examples:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--

Screenshot 2024-08-29 at 9.26.00 AM.png

 

Regardless, I have tried this example syntax myself using Log actions in a rule that uses the same trigger you specified (Field Value Changed for Issue Type or Parent), and using the Convert To Subtask  and Convert to Issue functions.

Screenshot 2024-08-29 at 9.40.38 AM.png

While the rule is triggered it appears that the information for those fields is not written into to the Change Log accessible in the Automation Rule, when the Convert To functions are used.

This is what I got when I converted an issue to a Sub-task:

Screenshot 2024-08-29 at 9.41.38 AM.png

 

And when I converted a sub-task to an Issue the rule was not triggered at all.

Like Sid007 likes this
0 votes
Duc Thang TRAN
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 26, 2024

Hello @Sid007 

For me is correct your condition 

Do you have only one condition, or do you have more conditions? If you have more conditions, can you try if else condition ?

 

Sid007 August 26, 2024

I have more, but i just want answer to using the smart values for issuetype history search.

Duc Thang TRAN
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 28, 2024

@Sid007 

It working fine with these smartvalue for me . 

Can you share the auditlog ? The trigger need to be "When field change" 2024-08-28 14_13_16-Audit log - Automation - Scrum03 - Jira.png

Sid007 August 29, 2024

tried same, didn't work for converting an issue type from subtask to task issue type.

Duc Thang TRAN
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 30, 2024

Hello @Sid007 

I haven't tested converting a subtask into a task yet.

From what I've found online, it seems that when converting a subtask into a task, you need to trigger a field value change for the 'parent field.

https://jira.atlassian.com/browse/JSWCLOUD-22432

However, it's strange that smart values like changelog or fieldChange don't seem to work as expected.

 

 

Suggest an answer

Log in or Sign up to answer