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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"} ],
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.