Using confiforms field type dropdown for Impacted Service(s),Country,PSS Priority,Target Version(s and checkbox Applications Impacted, i need to pass value using json to update jira ticket but when i am trying to update it i was facing the below issue.
Cash' passed for customfield 'Applications Impacted'."
Please do me a needful
Waiting for your positive response
Thanks,
Sunil G
Hi
How do you map a "priority" field in ConfiForms JSON mapping?
It should be something like
"priority": { "name": "Critical"
}
Or
"priority": { "id": "priority id" }
What do you have?
Alex
"key": "[entry.keyCF]", "fields": { "project": { "key": "DCDAPROD" }, "summary": "[entry.summaryCF]", "description": "Testing Successful", "customfield_18945": "[entry.serviceName]", "customfield_12265": "[entry.Acceptancecriteria]", "priority": "[entry.priority.id]", "customfield_14004": "[entry.ApplicationsImpacted.id]"
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.
You can probably see it yourself and fix, but... see how you have the priority field mapped and how I was suggesting it should be mapped...
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using this field type I have maped in my confiforms
After using get method url I am able to fetch the id information using that I have mapped in inside the field as options.
Using Json Script I have modified for posting in jira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like a misunderstanding here
OK... here is the steps you need to do
Change the
"priority": "[entry.priority.id]",
to
"priority": { "name": "[entry.priority.label]" }
In your mapping
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Alex,
Thanks for your prompt response.
I am able to access now.
And i have done same for another field using checkbox for Impacted Services Using Api i am able to fetch id and value for impacted services using below json i am typing to update in jira.
And using Json:
"customfield_14004": { "value": "[entry.customfield_14004.label]" }
Error :
And for Impacted services i have used the same field has a dropdown i am facing same issue while updating ticket.
Used Json value inside:
"customfield_14004": { "value": "[entry.customfield_14004.label]" }
Is i am using correct field for Impacted Service in confiforms?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I cannot tell that, as I have no idea what your "customfield_14004" in Jira is - what type is it..
But it's clearly something else than what you put - seems to expect an array
See what different Jira field types expect https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
Sorry that was an Applications Impacted field i am using for customerfield_14004
"customfield_14004": [
{
"self": "http://xxxxxxxxxxxx/rest/api/2/customFieldOption/xxxx",
"value": "CADM",
"id": "xxxx"
It showing like this in my API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Medved _ConfiForms_ is this the same for when creating an Jira Issue at the same time? I tried and can't seem to get it to work with that syntax (everything except the priority field works). I get the error that 'priority cannot be set, it wasn't found on the screen'. I'm guessing I'm trying to access it incorrectly. I tried using both the field id and label:
{
"fields": {
"project":
{
"key": "XXXXX", //not my actual project key, just removed for this post
"id": "XXXXX" //not my actual project ID, just removed for this post
},
#set($maint = "[entry.maintenance]")
#if($maint == "Maintenance Required")
"customfield_13212": [ {"value": "[entry.maintenance]"} ],
#end
"customfield_10507": "[entry.fiscalYear]",
"customfield_13224": "[entry.fundingDocument]",
"customfield_12733": [entry.estimatedCost],
"customfield_20109": ["[entry.customerActivity]"],
"customfield_13117": ["[entry.productType]", "[entry.maintenanceType]"],
"customfield_12744": "[entry.requiredDate]",
"assignee": {"name": "adubois"},
"customfield_13227": {"name":"[entry.customerName]"},
"customfield_11309": "[entry.startDate]",
"priority": { "name": "[entry.priority.label]" },
"customfield_11308": "[entry.endDate]",
"customfield_14614": "[entry.itprNumber]",
"customfield_14905": "[entry.localTrackingNumber]",
"summary": "[entry.summary]",
"issuetype": { "name": "Contract Package"},
"description": "[entry.comments.escapeJSON]"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This error just tells you that priority field cannot be set as it does not exist or is not present in jira create/edit issue screen
This is not about what you set, but if it’s possible to set
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Medved _ConfiForms_ success! Thanks for the easy solution! (and for being very responsive in general on this forum, it is very much appreciated!)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Medved _ConfiForms_ - Curious about Jira checkbox fields as well.
When I use a single choice for the checkbox it works, but when I try to add a second condition it stops working.
#if(${1needed.label} == 'Yes') "customfield_18700": [{"value": "Option1"}], #end
#if(${2needed.label} == 'Yes') "customfield_18700": [{"value": "Option2"}], #end
Tried to use set, but that isn't working either.
#set ($customfield_18700 = ' ' )
#if(${1needed.label} == 'Yes') #set ($customfield_18700 = '{"value": "Option1"}') #end #if(${2needed.label} == 'Yes') #if($customfield_18700 != ' ' ) #set ($customfield_18700 = $customfield_18700 + ',') #end #set ($customfield_18700" =$!{customfield_18700} + {"value":"Option2"}') #end #if($customfield_18700 != ' ' ) "customfield_18700" : [${customfield_18700}], #end
Error - Could not prepare JSON
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error tells you that the logic you have put in a your template generates an invalid JSON
Hard to tell what is wrong by looking at the snipped, but the error should also show the resulting document that it could not accept
That should give you a hint what is missing
Alex
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.