Can a Jira form set a value in a Jira field, without linking the form field to a Jira field?

Daniel Blomqvist
Contributor
December 6, 2024

Hi Atlassian,

I want to use an internal Jira form to trigger certain actions using automation without adding a bunch of custom fields to the request type.

Current Scenario:

  1. A request is submitted via the portal

  2. A person reviews the ticket internally to prioritize and sets the priority field manually

When it comes to step 2 I want to use a Form to select radio buttons for Effort, Impact, and Deadline and based on the selected values automatically give the ticket a priority value from a drop-down list.

E.g. if Effort is High, Impact is High and Deadline is long set the CAP Matrix field to A2.

CAP Matrix Form.png

I know how I could do it if each Form field would be linked to a Jira field, but I don't want to add several Jira fields to each request type and was hoping to accomplish this using the selected values in the submitted form fields instead.

  1. Can this be accomplished without linking the form fields to jira fields that are added to the request type?
  2. If no, can I use jira fields without adding them (making them visible) on the request types issue view?

This example is for a quite short form but we want to use the same logic for forms that are longer.

I tried to create an automation using smart values based on the key set in the form field, but I'm not sure if this is the correct approach.

CAP Matrix rule.png

3 answers

1 accepted

1 vote
Answer accepted
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.
December 6, 2024

Hi @Daniel Blomqvist 

That would be nice, and theoretically yes.

I do think it required to enable the save as PDF option, and you might need to do a re-fetch before the IF/ELSE

See if this makes a difference.

Daniel Blomqvist
Contributor
December 6, 2024

Thanks @Marc - Devoteam 

The automation "technically works" it changes the CAP Matrix field when I submit the form, but it always stops/accepts at the first IF condition and sets it to A1 no matter what I select in the form.

I tried adding a re-fetch, but that didn't change anything.

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.
December 6, 2024

Hi @Daniel Blomqvist 

I think you need to create 3 variables, based on the input of Effort, Impact and Deadline.

Then base the if/else options on the values stored in the variables and the options you can choose.

Daniel Blomqvist
Contributor
December 6, 2024

@Marc - Devoteam 

To be honest, I haven't used variables in my rules before, so this is new to me.

  • I tried adding a variable for Effort to start with
  • Naming it CAPeffort
  • As the smart value, I used {{form.last.cap_effort.label}}
    • As that should return the form field value High, Moderate, or Low according to this resource.rule 1.png
  • In the IF/ELSE I used the smart values condition and used {{CAPeffort}} as the first value and High as the second value
    • Same but with Moderate and Low for the second value for the ELSE.rule 2.png

But the audit log says "The following issues did not match the condition:" for all of them.

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.
December 6, 2024

Hi @Daniel Blomqvist 

Add a log action after the creation of the variable and log the variable, what does the log action provide as result?

 

Daniel Blomqvist
Contributor
December 6, 2024

Like this you mean?log action1.png

log action.png

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.
December 6, 2024

Hi @Daniel Blomqvist 

Yes and there is no result in the variable.

So looking back on your form, your radio button option is called Effort, so the smart clause used when creating the variable should be:

 {{forms.last.Effort.label}}

Do you get result at the log action?

 

Daniel Blomqvist
Contributor
December 6, 2024

No sorry no Log for that either.log action 2.png

 

Since I put in a "Field key" in the form I was under the impression that I should use that.Request Analysis Form.png

 

But I tried both {{forms.last.Effort.label}} and {{forms.last.cap_effort.label}} before and after removing the "Field key" and saving the form.

I also tried a different "Field key" capeffort without the under score (_) but that did not help.

Daniel Blomqvist
Contributor
December 9, 2024

Hi @Marc - Devoteam 

Sorry to bother you, do you have any other suggestions?

Daniel Blomqvist
Contributor
December 10, 2024

Hi @Marc - Devoteam 

Sorry to bother you, do you have any other suggestions?

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.
December 11, 2024

Hi @Daniel Blomqvist 

I figured it out.

In the rule the action Attach Form is required and you indeed need to set Field key, to retrieve the set information. (Field key is capital sensitive)

See my simple example:

I made a form with the field "Urgency" and Field key "urgency".

Screenshot 2024-12-11 at 12.49.17.png

Daniel Blomqvist
Contributor
December 11, 2024

Hi @Marc - Devoteam 

Thank you, that is strange because it's not working for me.

  • I tried creating a new form with just 1 radio button field and set the field key to "urgency"marc 1.png
    • If the old form was the problem.
    • If the fact that the fields were placed in a table would make any difference.
    • If the form settings would make any difference I've let them be defaultmarc 1.2.png
  • I tried making a new rule just like yoursmarc 2.png
    • If the old rule was the problem.
    • But every time I submit a form I get "The following issues did not match the condition:" for the IF block
      • So I tried adding the Log action at the start and once again it doesn't return any value.marc 3.png
    • And I'm not sure I understand the logic behind adding the Action Add Form I this rule.
      • For me, it makes no difference if it's there or not other than me getting an extra form added to the ticket that I don't want/need.

Do I need to report this as an issue somehow?

Daniel Blomqvist
Contributor
December 11, 2024

Sorry the 3rd and 4th image is in the wrong order.

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.
December 11, 2024

Hi @Daniel Blomqvist 

On the form config I see you didn't add the from to a request type, this is required otherwise the form is not used on a request type.

Steps are simple

  1. create a form
  2. add fields to the form
  3. for each form field to be used in automation, set the Field key value
  4. attach the form to a request type
  5. create automation
    1. trigger: from submitter
    2. action: attach form
    3. condition based on from input: {{forms.last.<Field key>.label}}
    4. required actions
Daniel Blomqvist
Contributor
December 11, 2024

Hi @Marc - Devoteam 

Yes, that is correct I don't add it to the Request Type, because if I do the form is shown to the portal and we don't want our Reporters to see or fill out this form, it's for internal use only.

 

However, I found this article and tried to replicate the 1st example by creating a new form and a new rule (again) to make a simple comment on the ticket, and for some reason that worked.

So I started adding radio buttons, checkboxes, drop-down, and when that worked I tried adding the IF condition, and now that also works, even though the logic is practically the same as before.

And just as a note:

  • I didn't need to add the form to a Request Type in the form settings
  • I didn't need to add the action Add Form in the rule
Like Marc - Devoteam likes this
Daniel Blomqvist
Contributor
December 12, 2024

As a summary for future readers.

Technically I never figured out the issue with the first form and automation I made and why it didn't collect the values from the Jira form.

  • Here is a screenshot of my current working formworking form and automation 1.png
  • Here is a screenshot of my current working automationworking form and automation 2.png

Important note: You have to set the "Field key" to use the smart value {{forms.last.capdev-effort.label}} in the automation.

Resources:

Thank you @Marc - Devoteam and @John Funk for the support.

Like # people like this
1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 6, 2024

Hi Daniel, 

I would say yes, if you used an automation rule to use those fields to do the action, based on a Form Submitted trigger. See this article for guidance on this new functionality for using Form fields in Automation rules. 

https://community.atlassian.com/t5/Jira-articles/Forms-Automation-Access-form-fields-with-smart-values/ba-p/2862665

 

Daniel Blomqvist
Contributor
December 6, 2024

Thanks @joh , the linked page Access smart values for forms and form fields in the announcement is what I have been using but I haven't been able to figure out which smart value to put in to an IF/ELSE condition to identify for example:

  • If the form field Effort is High set CAP Matrix to A1
  • If the form field Effort is Low set CAP Matrix to B1

I was trying to use {{form.last.cap_effort.High}} to identify High as the selected value in the Form field, but it doesn't seem to work.

Request Analysis Form.png

Daniel Blomqvist
Contributor
December 6, 2024

Sorry for the incorrect tag @joh I meant to tag @John Funk 

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 6, 2024

I just did something similar and used the {{smart values}} condition. The first value in your case would look like {{forms.last.Effort.label}} 

Condition is: equals

Second value is High

Then put your action for Edit issue under that and set the CAP Matrix field to A1

Then put in another {{smart values}} condition for Low and set the field to B1

You might want to post your whole rule here though for help if that doesn't work as you would like. 

Daniel Blomqvist
Contributor
December 6, 2024

I tried this (see image) as this is how I understood your message above and the log says "The following issues did not match the condition:" for both blocks.

So somehow it doesn't recognize the values that I select in the form.

And this is the whole rule.rule label.png

Daniel Blomqvist
Contributor
December 9, 2024

Hi @John Funk 

Sorry to bother you, do you have any other suggestions?

Daniel Blomqvist
Contributor
December 9, 2024

I also tried the smart value {{form.last.Effort.label}}, both with the "Field key" field in the form set to blank or Effort and the log still says "The following issues did not match the condition:" for both blocks.

Effort.png

Daniel Blomqvist
Contributor
December 10, 2024

Hi @John Funk 

Sorry to bother you, do you have any other suggestions?

0 votes
Daniel Blomqvist
Contributor
December 9, 2024

A possible workaround that works:

I tried linking the Effort form field to a (similar) Jira field called "Level of effort" (that I don't have on the issue screen or in the request type).level of effort.png

  1. When the form "Request Analysis" is submitted
  2. I used the "Level of effort" Jira field values as IF/ELSE conditions
  3. To trigger an Action, in this scenario:
    1. Hard (representing High) setting CAP Matrix to A1level of effort 2.png
    2. Easy (representing Low) setting CAP Matrix to B1

This way I could accomplish what I wanted with the form without adding any custom Jira fields to the issue screen/request type, the values are logged in the background.

But it does require 1 custom Jira field per Form field, which I'm trying to avoid.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events