I'm pretty new to working with Forms and automated rules in Jira, so please bear with me if this has an obvious answer I'm clearly missing!
I have a Form I created in Jira Forms and a corresponding rule that fires when the form is submitted. I'm using the Edit Issue action in my rule to set the Description of the issue based on various responses in the Form itself.
Most of this is working out great. For example, all of these work fine:
*Submitted By:* {{issue.reporter.displayName}}
*Due Date:* {{forms.last.standardDueDate.fullDate}}
My issue is that I'm trying to add text based on the .id property of certain fields in my form. Looking at this documentation, I see that a dropdown and a checkbox type component in my form have the .id property. I have a checkbox component whose field key I set to "dueOnCheck" and a dropdown component whose field key I set to "requestType". And when I run my rule with these set:
forms.last.dueOnCheck.id = ({{forms.last.dueOnCheck.id}})
forms.last.requestType.id = ({{forms.last.requestType.id}})
I get (1) and (10262), respectively.
But neither of these if statements are executing:
{{#if(equals(forms.last.dueOnCheck.id, 1))}} test{{/}}
{{#if(equals(forms.last.requestType.id, 10262))}} second test {{/}}
I've got other if statements that do work, and I've tried so many other things, but it seems like it might be due to the .id property, as when I tried explicitly casting them as strings or numbers, my output was (), even though without casting them I got the correct value.
Can anyone provide me some guidance here on what I might be doing wrong, or how this is meant to work?
@Laurel Page
Welcome to the community. Can you help me out by posting a screenshot(s) of the automation and the details within the automation so we can see the full outcomes you are looking for?
I would also like to know what you are trying to achieve by these automations.
This will help me and other community leader or Atlassian professional digest what you are trying to achieve.
Waiting to see the automations, and again welcome to the community.
The end goal is to add different text to the ticket depending on which request type was set in the requestType form field.
Here's what the rule looks like (and the rule itself functions fine, as in, it's triggered as expected, and sets all the other text within the Description field. It's just the conditionals based on .id properties that is giving me issues).
In the screenshot, you can see several test if statements 1-5 -- the first 3 these function just fine, while the 4th and 5th don't work at all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would split those up into different if else statements if possible. I think that would fix the issue.
Would that work? I think your hitting sometime of limits within the edits if else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That was going to be my "last resort" workaround. But I was hoping to avoid doing that because majority of content in the description field is going to be the same across like, 30 different request types. So having that many branches felt unnecessary.
And I would really just like to understand why the .id comparison doesn't work. It seems like what I'm doing *should* work based on all the other comparisons that I've tested, but that there's something strange about .id.
For example, I tried converting the value to a string to see if data type was the problem, and when I did that, my output was simply () instead of (1).
And breaking it up into different if/else statements wouldn't work for checkbox option. This is just meant to check if a box on my form was selected or not, and add some text to the description if it was checked, but do nothing if it was not checked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.