...
Script |
| Script (amendment for radio buttons) |
Code Block |
---|
Closure<String> getFieldId = { def property, String field ->
def slurper = new groovy.json.JsonSlurper()
def parsedJson = slurper.parseText(property.value)
for (def question : parsedJson.design.questions){
if(field.equals(question.value.label)){
return question.key
}
}
} |
Installation instructions
If used in a transition:
Comment line 2
Uncomment line 4
Change formName in line 6 to the name of the form that has all fields used in the script.
Change/Add in fieldNames in line 7 the name/label of all fields you want values from, separated by comma, between quotation marks.
Change noValue in line 8 to the message you want to show when no value is found on a field.
If you want to add values in the end of the issue description instead of overriding it, comment line 122 and uncomment line 123.
If used in the script console:
Change the issue key in line 2 to the key of the issue you want to sum the field values in a form.
Change formName in line 6 to the name of the form that has all fields used in the scripts
Change/Add in fieldNames in line 7 the name/label of all fields you want values from, separated by comma, between quotation marks.
Change noValue in line 8 to the message you want to show when no value is found on a field.
If you want to add values in the end of the issue description instead of overriding it, comment line 122 and uncomment line 123.
Possible use cases
Copying data from multiple ProForma fields into a single Jira fields makes the data searchable in JQL queries and Jira reports.
Summarize key data points collected in long, complex forms.
Limitations
All fields that will be included must be on the same form, and the same issue.
If one of the fields being collected has no value, then that field will be shown as “No value” in the Description field.
The script can be used to override or amend to, existing values in the Description field.
If there are multiple copies of the same form on the issue, the script will run for each copy of the form.
This script may not work if the form is over 32 KB. You can limit the size of your forms by using multiple smaller forms, and by including character/word limits on your text fields.
...