Using Confiforms fields Multi-select
i have provided ID and Labels. When i am trying to pass values using JSon script as Custom field type: Impacted Service(s)
"customfield_26340": [[entry.impactedservice.asArrayMultiSelect]]
I am not getting any error message and it was not reflecting in jira ticket. using get method URL i got the below json response using this i am mapping in confiforms json values.
"customfield_26340": [
{
"self": "http://xxxxxxxxx:8081/rest/api/2/customFieldOption/100345",
"value": "NG - Trade",
"id": "100345"
},
{
"self": "http://xxxxxxxxxxxxxxxxxxxx:8081/rest/api/2/customFieldOption/100346",
"value": "API Banking",
"id": "100346"
}
],
Hi
Are you sure you Jira field expects something like this as input?
"customfield_26340": ["100345", "100346"]
As this is what you are trying to pass from ConfiForms
I cannot tell what field type is your customfield_26340
But probably it accepts something like
"customfield_26340": [{"id":"100345"}, {"id":"100346"}]
In this case the mapping should be something like
"customfield_26340": [[entry.impactedservice.asArrayOfKVPairs(id)]]
Alex
Hi Alex,
I have used the above mapping case, It was not reflecting in jira dashboard.
"customfield_26340": [[entry.impactedservice.asArrayOfKVPairs(id)]]
in Jira Dashboard the field type looks like this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does not look like a multi-select field to me. Does it allow a single value only to be selected?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
I have selected multiple values and i get JSOn response.
"customfield_26340": [
{
"self": "http://xxxxxxxxxxxxx/rest/api/2/customFieldOption/100345",
"value": "NG - Trade",
"id": "100345"
},
{
"self": "http://xxxxxxxxxxxxxxxx:8081/rest/api/2/customFieldOption/100346",
"value": "API Banking",
"id": "100346"
}
],
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, when you create an issue in Jira via ConfiForms do you see the "customfield_26340" field has values?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No I am not able to see this customfield_26340 in jira Dashboard while updating or creating, but when i use get method URL to fetch the values , i am getting above json response and values are assigned to that customfield_26340 field using that i have mapped in json.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What do you mean by "Dashboard"?
When browse to the created ticket, do you see the field filled? What JSON mapping do you use (full code)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have created ticket in jira in that i have field type as Impacted Service(s): so i have selected multiple values in that and i have updated that ticket.
So i use get method url to fetch the information using postman i got the response like below.
"customfield_26340": [
{
"self": "http://xxxxxxxxxxxxx/rest/api/2/customFieldOption/100345",
"value": "NG - Trade",
"id": "100345"
},
{
"self": "http://xxxxxxxxxxxxxxxx:8081/rest/api/2/customFieldOption/100346",
"value": "API Banking",
"id": "100346"
}
],
Using this json response I am mapping in my confluence confiforms like in below
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, why do you put something like "ImpactedService" then you need to set a "customfield_26340" as Jira REST API expects and requires!?
And as I have mentioned and explained earlier...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
When i used customfield_26340 it was not giving any error in confluence confiforms and changes are not reflecting in Jira.
But when i use impactedService in json it was not working and i am facing issue below.
"Impacted Service(s)":"Field 'Impacted Service(s)' cannot be set. It is not on the appropriate screen, or unknown."}}
So now i changed with customfield_26340 in my json.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, instead of understanding and fixing this error you decided to rename the field!?
OK, the error (and you really need to learn the Jira REST API and how it works) tells you that the field you are attempting to set is NOT on the Jira create issue screen and therefore cannot be set on create
You can verify it yourself - open the form in Jira for this project/issue type and try to find this "customfield_26340" field on that form
In order to set the field you need to have it on the (Jira) form... on the "Create Issue Screen"
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 for delay response
I am able to pass values using this mapping
[[entry.Impactedservice.transform(label).asArrayOfKVPairs(value)]]
Thanks a lot for your prompt support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great, that is why it is important to understand what Jira expects from you - is it an array of IDs or labels.. and how the "key" part should be constructed. Sometimes it is an "id", sometimes it is a "value", sometimes it is a "name"
This page helps with that - https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/
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.