Hi @Nate Jenks
This is possible, although it's a workaround, and you do need a (free) App.
---
App - Entity Property Tool for Jira
App is here: https://marketplace.atlassian.com/apps/1214509/entity-property-tool-for-jira?hosting=cloud&tab=overview
You're going to use this App to find the relevant IDs needed below. You can choose to limit who can see this tool (yourself or everyone), and turn it off when not in use if preferred.
---
Automation Rule
The rule is just an example, see below on how it works using a single-line text field:
- Trigger: Scheduled Issues
- Run rule every = 1 Weeks
- Run a JQL search and execute actions... = TRUE
- JQL - locate relevant issues
- Only include issues that have changed... = FALSE
- Condition:
- First Value = {{issue.properties."proforma.forms.i1".state.answers.2}}
- Condition = does not equal
- Second Value = Empty - leave field empty
- Action: Edit Issue
- Field = Text Field
- Value = {{issue.properties."proforma.forms.i1".state.answers.2.text}}
---
Form Field IDs
This is how the form field smart value works:
- {{issue.properties."proforma.forms.i1".state.answers. - this allows you to access form fields, based on their entity property IDs
- The 2 above is the ID - you can access that from the Entity Properties on an Issue once the App is installed...
- Go to the bottom of an Issue, and select "Entity Properties" from the Activity section
- Look in the proforma.forms.i1" section
- Look for the question ID, eg.
- "2": {
"type": "ts",
"label": "<name here>",
"description": "",
- The field type will then judge what you need to do next - and not every form field can be displayed as text (eg. select lists are only available as choice IDs). For example...
- Text: You can access the text value by adding the smart value text denominator - eg. {issue.properties."proforma.forms.i1".state.answers.2.text}}
- Select List: You can't access the label data here, so you'll need to use the IF Block Condition, and the Advanced Compare Condition, to populate a Jira field, such as...
- Condition: IF Block...
- IF...
- Sub-Condition: Advanced Compare Condition
- First Value = {{issue.properties."proforma.forms.i1".state.answers.3}}
- Condition = contains
- Second Value = choices=[1]
- Sub-Action: Edit Issue
- Field = Select List Field
- ELSE-IF...
- Sub-Condition: Advanced Compare Condition
- First Value = {{issue.properties."proforma.forms.i1".state.answers.3}}
- Condition = contains
- Second Value = choices=[2]
- Sub-Action: Edit Issue
- Field = Select List Field
- ...etc
- You can get the choice ID from the Entity Properties also, but you'd need to check one Issue per select choice option, eg.
- "choices": [
{
"id": "1",
"label": "<choice wording here>",
"other": false
---
Other Notes
- Trigger: You don't need to run the rule on a schedule - this trigger lets you run the rule manually immediately. So you could run the rule, get the data moved to a Jira field, then disable it after.
- Log Action: If you want to test the output of the smart value prior to using it on the Issue itself, use the Log Action action, to place the value in the Automation Rule's audit log. That way you can test the result without modifying Jira.
- This is especially useful when testing the smart value outputs of different form field types
- There is a suggestion to add this functionality, see JSDCLOUD-10697, but the last update in March 2023 suggests adding this feature isn't on the short-term roadmap. However, improving the REST API for forms is a WIP, see JSDCLOUD-10671
---
Let us know if this works for you!
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.