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
This will set a select list value based on another onn edit.. I'm now on looking on how to create a new option..
This works on the Current Epic
Thanks for that @Darren Pegg - I'm afraid that does not work :(
I want to edit it with JSON and then use it as a variable as you have started with ...
I cannot use the field, as you have for EPIC Name (reportable) as you have as it is an custom app field and not a custom field created on Jira itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am starting to sound desperate on this ... because I am :D Any idea anyone, please? Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wonder if anyone has found a solution to this please? Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hope I can get more visibility on this ... still looking for a solution to this. Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Someone? Anyone? Somewhere? Any idea on this please? Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I´m afraid I don´t have any further ideas here :-/
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
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.