Forums

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

Using radio value for automations

Erik van der Valk
Contributor
March 6, 2025

I'm having trouble creating an automation that uses a radio value to conditionally show or hide certain information.

The data comes from a form that eventually creates a new ticket in another project.

However, I made it simple to demonstrate the problem I'm running into.

  • I have an automation that triggers on form submit.
  • A lookup table called `radio`.
    • Key/value
      1/Yes
      2/No
  • A log to audit with `Developer: {{issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isDeveloper}} | {{radio.get(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isDeveloper.value)}} | {{#if(equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isDeveloper, "1"))}}Yes{{/}}`

It returns:
```

Log action 03/06/2025, 14:17:17
Developer: 1 | |
```
However I'm unable to figure out why `{{issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isDeveloper}} returns the 1 (for Yes) and 2 (for No) but neither the radio lookup table or if equals works...

Can someone tell me what I'm doing wrong?

Kind regards

3 answers

1 accepted

1 vote
Answer accepted
Erik van der Valk
Contributor
March 6, 2025

Thank you for the reply:

Using `.label` got me a little further but the check for equals still doesn't work correctly.

```

Support Desk: {{issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk}} | {{issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk.label}} | {{#if(equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk.label, "Yes"))}}Yes, with support desk access.{{/}} | {{equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk.label, "Yes")}}
```

  1. You're in a company-managed project
  2. The automation
    1.PNG
  3. The form
    2.PNG
  4. The log
    3.PNG
  5. The problem specifically lies with:
    ```
    {{#if(equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk.label, "Yes"))}}Yes, with support desk access.{{/}} | {{equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk.label, "Yes")}}
    ```
    Neither does it show "Yes, with support desk access." nor is `{{equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk.label, "Yes")}}` returning `true` when the label matches 'Yes'.

Perhaps, with this information, the use-case is a bit more clear. It feels like I'm missing something obvious...

Thanks again!

Marc - Devoteam
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.
March 6, 2025

Hi @Erik van der Valk 

What is your goal with your automation, log the values selected?

The set values can be seen in the form linked to the issue.

As I understand, you want to use information from the form to trigger an automation rule to create an issue in another project.

So this is not when the form is submitted, but at a later moment in time, correct?

If you want to do this, you need to format the form option as follows in a rule, see the part Access smart values without using the Forms submitted trigger" in the article you shared initially

Example:

{{issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.isDeveloper}}

based on the field type used in the form you need to find the ID of the option selected. Use API or the browser developer.

Erik van der Valk
Contributor
March 6, 2025

> So this is not when the form is submitted, but at a later moment in time, correct?

The component for creating the new ticket is directly after when the form is submitted.

I want to use the value in the 'Create a new' component. This is to dynamically include or exclude list items in the description field of the new ticket.

The automation is very simple.

4.PNG

Where the description of the new ticket contains:

```

*Summary:* {{issue.summary}}

*Description:*
{{issue.description}}

*Accounts:*
{{issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.accountDetails}}

*Products:*
{{issue.components.name}}

*Actions:*
{{#if(equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk.label, "Yes"))}}* Create a support desk invite.{{/}}
{{#if(equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isDeveloper.label, "Yes"))}}* Create a license.{{/}}

```

The 'Account' part of the description works as you'd expect. The 'accountDetails' are shown in the newly created ticket coming from the form.

The 'Actions' part of the description I'm trying to simulate by using the 'Log' component of the automation does not.

So far I've tried:

  • {{#if(equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk.label, "Yes"))}}* Create a support desk invite.{{/}}
  • {{#if(equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk, "1"))}}* Create a support desk invite.{{/}}
  • {{#if(equals(issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isSupportDesk, 1))}}* Create a support desk invite.{{/}} (as a last effort but obviously `1` is not a variable.

In these tests 'equals' always returns false.

The comments prior to this are simply to get the smart value to display using the Log component to prevent creating new tickets each time I test it but I can't seem to get it right.

Marc - Devoteam
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.
March 6, 2025

So this Actions is a field.

You can't use form information like this.

You can't compare this in this way, the information stored in the form options are not variables.

You could try if you could store the form field output in a variable and then use this to compare

Like Bill Sheboy likes this
Erik van der Valk
Contributor
March 6, 2025

Great tip. Using the 'Create variable' seems to work weirdly enough.

5.PNG

Then, in the smart field:

```
{{issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isDeveloper.label}}
```
And finally using:

```
{{#if(equals(isDeveloper, "Yes"))}}* Create a license.{{/}}
```

I wouldn't have figured this out using the documentation, and it's counterintuitive but it works.

Thank you for the help.

Like Marc - Devoteam likes this
1 vote
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.
March 6, 2025

Hi @Erik van der Valk 

As @Marc - Devoteam notes, using the Create Variable action to first store a smart value and convert it to text can solve several challenges in rules:

  • Timing / racetrack errors
    • Some smart values are looked up just-in-time.  Because of that they may not be fully evaluated before they are needed in some rule expressions, leading to a null value being used.  This happens frequently with the Edit Issue and Send Web Request actions with JSON, and with the Send Email action's body.  The solution is to use Create Variable as it will fully evaluate and store the result before the next rule step proceeds.
  • Data type incompatibility errors
    • Some smart values preserve the data typing (e.g., integer, dates, text, JSON objects, etc.) and thus might not be compatible with some rule features.  The lookup table's get() function is much more forgiving than other rule features, but it cannot handle everything.  Storing a value in a Created Variable forces it to text, which is quite helpful as it is a known starting point to perform other rule actions or type conversions.

And, please note well: when using the Create Variable action, I recommend always using a name which cannot overlap with other field / smart value names.  This will prevent the rule processing, and people reading the rule, from getting confused.  For example, I always add a prefix to variable names, such as varIsDeveloper.

Kind regards,
Bill

Erik van der Valk
Contributor
March 6, 2025

Thank you Bill, I'll be adopting this naming convention too. That sounds like a good practice to avoid confusion!

Like Bill Sheboy likes this
0 votes
Marc - Devoteam
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.
March 6, 2025

Hi @Erik van der Valk 

Whenever you ask for help with an Automation Rule it will help us to help you if you provide:

1. what type of project is this (e.g., company-managed, team-managed, etc.), 

2. images that show your complete rule.

3. images showing the details of any relevant actions/conditions/branches.

4. images showing the Audit Log details for the rule execution.

5. Explain where the issue is.

These questions are not for not willing to help, but to have community members understand on how automation works.

But you don't need a lookup table.

See usage here, access-smart-values-for-forms-and-form-fields 

Make sure the Field Key is set

Based on the form submission you can use a smart value condition.

{{issue.forms.1fb00898-1f81-44d0-9617-91eecb5db6b3.last.isDeveloper}} equals 1

Then you can use a action in the automation rule

Erik van der Valk
Contributor
March 6, 2025

Sorry, replied in the field. My comment is in the main thread. I tried providing all the relevant information as per your request.

Suggest an answer

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

Atlassian Community Events