The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

update custom field

Maria Kowalsa
May 12, 2021

hello,

 

my problem is, after I've use:

issue.update(fields={"customfield_10925":[{"0":"OC CS FI Customer Service (OC-6792)"}]})

customfield_10925 get null value, and should be

"customfield_10925":{

0:"OC CS FI Customer Service (OC-6792)"

}

I wonder how to fix it, is it problem with spacebars? How to get it right?

3 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Prince Nyeche - ELFAPP
Atlassian Partner
May 12, 2021

Hi @Maria Kowalsa 

What field type are you trying to update? You mentioned list type but can you give the field type name as its shown from your custom field configuration from Setting > Issues > custom field? That will enable us to know what is the expected data type you're to post.

0 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
May 12, 2021

Hi @Maria Kowalsa , how do you update the field? In Automation? Script runner  postfunction?

Maria Kowalsa
May 12, 2021

Hi, whole python script looks like:

from jira import JIRA

HOST={'server':'https://.../'}
PASSWORD='...'
USER='...'

j = JIRA(basic_auth=(USER,PASSWORD),options=HOST)

issue = j.issue('CM-90')

issue.update(fields={'customfield_10925': [{'0':'OC CS FI Customer Service (OC-6792)'}]})

 

I'm able to modify fields like: summary, description, but customfield_10925 it is a list type, not a text, and I'm not sure where I'm makeing a misstake.

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
May 12, 2021

Sorry @Maria Kowalsa but I'm not python developer, but at least your question is specified better :)

0 votes
Maria Kowalsa
May 13, 2021

I'm updating custom field like this:

issue.update(fields={'customfield_10925': [{"key" : "OC-6792"}]}), and it works.

The problem was key value, I shouldn't use whole string''OC CS FI Customer Service (OC-6792)'', but the reference to databasa 'OC-6792'.

Thank you :)