How would one populate a Jira Custom Field everytime a Confiforms form is submitted?

Curtis Freudigmann
Contributor
August 15, 2018

Hello again!

I am working on a Confiforms form and I am using IFTTT to create a Jira Issue when the form is submitted. I have been able to get a summary and description to work perfectly. However, there is a custom field for the issue type that is being created which, based on the selection, chooses which board to show it on.

Below is the code that I have that works:

{
   "fields": {
       "project":
       { 
          "key": "ID"
       },
   "summary": "[entry.Summary]",
   "description":"File Direction: [entry.fileDirection], Source Type: [entry.sourceType], 
Source Resource: [entry.sourceResource], Source Path: [entry.sourcePath],
Source File Pattern: [entry.sourceFilePattern], Source Delete: [entry.sourceDelete],
Rename: [entry.rename], Zip Name: [entry.zipName], PGP Key Name: [entry.pgpKeyName],
Target Type: [entry.targetType], Target Resource: [entry.targetResource],
Target Path: [entry.targetPath], Target To Email: [entry.targetToEmail],
Target From Email: [entry.targetFromEmail], Target Email Code: [entry.targetEmailCode],
Notify Failure: [entry.notifyFailure], Notify Success: [entry.notifySuccess],
Additional Comments: [entry.additionalComments]",   "issuetype": { "name": "IT Help" } } }

 

So I would like to add:

"customfield_12703": "Apps Admin",


But it errors out. I have tried to add it in different places within working block of code to no avail.

I have already visited

https://wiki.vertuna.com/display/CONFIFORMS/Creating+JIRA+issue+with+ConfiForms

as well as

https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions

and I was unable to find the answer I was looking for.

Any help or information would be greatly appreciated.

Thanks in advance!

-Curtis

1 answer

1 accepted

0 votes
Answer accepted
Davin Studer
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.
September 4, 2018

What is your field type? Is it a dropdown? If it is I believe the JSON syntax is this.

"customfield_12703": {
"value": "Apps Admin"
},

 Confiforms is just using Jira's REST api, so you can look at the Jira REST api browser to see what your syntax should be.

http(s)://{yourserver}/plugins/servlet/restbrowser#/resource/api-2-issue

Curtis Freudigmann
Contributor
September 5, 2018

Hello Davin,

Thank you for taking the time to respond to my question. Since posting this question I have found a working solution.

"customfield_12703": [ {"value": "Apps Admin" } ],

This is what I used to get it to work. The only difference being I have everything to the right of the colon in square brackets. What (if any) are the differences from what we have? Are there any best-practice things to keep in mind here? Also to answer your question the custom field is a multi-select.

Thanks again for the help!

-Curtis

Davin Studer
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.
September 5, 2018

Does the field allow multi-select? If it does then you would have to use the one that you have set as it is specifying an array (multiple values). If it is not a multi-select drop down then what I posted would work. If it is multi-select and you do want to supply multiple values you would do it like this ...

"customfield_12703": [ {"value": "Apps Admin" },{"value": "Another option too"} ],
Curtis Freudigmann
Contributor
September 5, 2018

Davin,

The field does allow the multi-select. Your point about it specifying an array makes sense. Thanks again for the help and clarification.

-Curtis

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events