Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Use Field Key in Portal Forms from Jira Service Management

Kim Andersson
Contributor
February 21, 2022

Hello!
I have a Data Connection in my Portal Forms connected to a singe-dropdown. 

WHen using a Data Connection, you aren't able to link the chosen data to a Jira field as you'll get the error:

A field cannot be linked to both a Jira field and a data connection.
If you wish to link to this Jira field, remove the data connection first.
How can I link this field to an existing Jira Custom Field in order to be able to SEARCH through JQL with this Custom Field as a parameter? 
Currently, the field seems to be some type of "virtual" field that doesn't connect to anything after the incident is created. 

2 answers

2 votes
Phong Nguyen - Atlassian Solutions Engineer
Contributor
June 23, 2022

I have an alternative solution for this, not ideal but might help.

1. After the issue is created, we can access the Forms field data based on its properties, fox example:

For the ID of the field:

{{issue.properties."proforma.forms.i1".design.questions.1.choices.get(0).id}} 

For the label of the field (display value):

{{issue.properties."proforma.forms.i1".design.questions.1.choices.get(0).label}}


NOTE: When a Forms field is used with a Data connection, it always has 2 properties: ID and label - as defined via the Data connection.

The exact structure of the smart value will depend on the structure/order of field in the Forms, to visualize it we can use Entity Property Tool for Jira.

2. Set/clone the Forms' value to another Jira custom field via Automation Rule. For example: the Forms field that is used for Data connection is named: Client (Forms), we clone the selected value into another Jira custom field called: Client, and use this custom field for the JQL.

Ref: https://community.atlassian.com/t5/Jira-Service-Management/How-to-access-the-form-data-in-Jira-Automations/qaq-p/2050277

Satham
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2024

The proposed solution did the job. 👍

0 votes
Guilhem Dupuy
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.
April 1, 2022

Hello @Kim Andersson ,

I'm pretty new to the use of forms to but to my knowledge, in order to link a form field to an actual Jira Custom field you need to use the "Linked Jira field" option, right on top of the "Data connextion" option.

Then the link will work both ways, which means that you form field will take values in your custom field, and when the form is created the value is copied in your jira custom field.

Does it help ?

Guilhem

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events