Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Trying to edit select field with Value not ID

Yatish Madhav
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.
October 5, 2022

Hi

I am trying to Edit a field through Automation using JSON on a custom field.

I would like to set the Cusom field Company with the value of Abcde

{
"fields": {
"Company": {
"value": "Abcde"
}
}
}

The above gives me this error:

XXX-85 (Can not deserialize instance of java.lang.Long out of START_OBJECT token at [Source: N/A; line: -1, column: -1] (app-key__field-key))

Please advise?

Thank you

5 answers

0 votes
Yatish Madhav
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.
January 30, 2023

I am starting to sound desperate on this ... because I am :D Any idea anyone, please? Thank you

0 votes
Yatish Madhav
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.
January 10, 2023

I wonder if anyone has found a solution to this please? Thank you

0 votes
Yatish Madhav
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.
December 8, 2022

I hope I can get more visibility on this ... still looking for a solution to this. Thank you

0 votes
Yatish Madhav
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.
November 23, 2022

Someone? Anyone? Somewhere? Any idea on this please? Thank you

0 votes
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2022

Hi @Yatish Madhav 

in order to have a better overview and analyze the problem could you please share a screentshot of your whole automation rule?

furthermore:
What type of field is the requested field? single select? Is "Abcde" configured as an option in your custom field?

Furthermore I would suggest to define the field you´d like to edit by the customfield_ID, eg.:

{
"fields": {
"customfield_10095": {
"value": "high"
}
}
}

 

Best
Stefan

Yatish Madhav
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.
October 5, 2022

Thanks @Stefan Salzl 

It is basically an Edit action with the More options > Additional fields set to the above JSON.

Company is a custom field single select dropdown created and populated via a custom connect app as on https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/

Abcde is an option in the Company field, yes.

Aim is to update the single select to have the Abcde option selected.

Thank you

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2022

I see. As far as I could understand in a short research custom fields created by apps could behave a bit different than native jira custom fields.

Unfortunately I can´t test this in my site. Here is a link I found that might provide a feasible solution. I would suggest to give it a shot:

https://community.developer.atlassian.com/t/tempo-error-when-trying-to-create-issue-via-the-jira-cloud-rest-api/28074

 

Best
Stefan

Yatish Madhav
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.
October 5, 2022

Thanks again @Stefan Salzl  - hehehe thanks for that link. Odd that I see my comment is the last one in there from Jul 2020 :D

So I can set the field based on ID of the field option ... but I only have the field option's value.

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2022

haha....mkay but as far as I understood the description in the link it should be possible to choose the just fill in the value but not as an object. did you try:

{
"fields": {
"customfield_xxx": "Abcde"
}
}
}

 

Best

Stefan

Yatish Madhav
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.
October 5, 2022

Yeah, :( I have tried that - I get:

Can not construct instance of java.lang.Long from String value 'Abcde': not a valid Long value at [Source: N/A; line: -1, column: -1] 
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2022

I´m afraid I don´t have any further ideas here :-/

Best
Stefan

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2022

Hi @Yatish Madhav,

I suspect that the field is storing the data in an interesting/non standard manner.

Could you create a test issue, set the field and then provide an export of the issue in JSON format?

Easiest way to do that is to use the URL format:

https://XXXX.atlassian.net/rest/api/2/issue/BIO-445?expand=names 

Where XXX is your instance and replace BIO-445 with your issue key. The output will then show us how this field is stored and we might be able to figure this out. If you don't want to paste the whole thing, look for the particular field and just post that part. It will be something like:

"customfield_xxxx": "XXXXXX"

Cheers,

Simeon.

Like Stefan Salzl likes this
Yatish Madhav
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.
October 26, 2022

Hey, Thanks @Simmo 

I think I figured this out (partially) through some other testing before I got back to investigating this :)

It comes back as this for the field set on the test issue:

"customfield_19381": {
"id": 84,
"value": "Abcde"
},

 So I tried setting it using this:

{"fields": {"Company":"84"}}

And yay, it set the Company field to Abcde value!

But (there seems to always be a but :( ), I want to set the value as I do know the string Abcde and not it's ID, unfortunately.

Then I tried the below :

{"fields": {"Company":"Abcde"}}

And I get: Can not construct instance of java.lang.Long from String value 'Doxim Internal': not a valid Long value at [Source...

Then I also tried this:

{"fields": {"Company": {"value":"Abcde"}}}

And get: Can not deserialize instance of java.lang.Long out of START_OBJECT token at [Source....

Please advise if there is any way on this? Please help .....

Thank you
Yatish

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2022

Hi @Yatish Madhav

I think you've already found the answer. It looks like you have to set this particular field by its ID, hence the Can not deserialize instance of java.lang.Long. It appears to be expecting a number when you set it. I'm not sure that you can get around this.

Unfortunately, you tried my only other suggestion, which was:

{"fields": {"Company": {"value":"Abcde"}}}

What type of field is this? Is it from another addon?

I suspect that the only way to set this might be via the ID. Does the field not show up in the list of fields that the Edit issue action supports?

Yatish Madhav
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.
October 30, 2022

@Simmo yes, that is why I said partially :) But yes, we do want to set the field using the name and not the ID as we have the field value.

The field is a single select /dropdown custom field on a custom connect app that we have developed and installed on the instance - i.e. see https://developer.atlassian.com/cloud/jira/platform/using-the-issue-field-module/

No the field does not show up under the list of fields :( This is also why I am looking to set it with the JSON route.

I wonder how else I could get more exposure of this issue so someone at Atlassian can confirm or disprove that suspicion. Hopefulle disprove. :)

Thank you

Yatish Madhav
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.
April 3, 2023

@Simmo or anyone .... I hope there is some way I can set a a single or multi select using automation Edit issue action with Json using the option name and not option ID? Thank you in advance.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events