1

Having an issue updating / modifying a JIRA issue's labels.

I've tried both of the below variations from the jira module documentation:

issue.update(labels=['AAA', 'BBB'])

OR

issue.fields.labels.append(u'new_text')
issue.update(fields={"labels": issue.fields.labels})

documentation

With the last example I'm getting this error:

JIRAError: JiraError HTTP 400
text: Field 'labels' cannot be set. It is not on the appropriate screen, or unknown.
url: https://jira.XXXXXXXXXX.com/rest/api/2/issue/XXXXXXXX
response text = {"errorMessages":[],"errors":{"labels":"Field 'labels'
 cannot be set. It is not on the appropriate screen, or unknown."}}

Anyone have any recommendations?

Specs:

Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
jira (0.50)
'rest_api_version': u'2'
Daniel Fortunov
  • 43,309
  • 26
  • 81
  • 106
propjk007
  • 655
  • 1
  • 10
  • 18

2 Answers2

5

It is administration issue.

  • You need administration rights for your Jira server, and log in.
  • Go to your "Project" under configuration
  • Go to "Screens" and
  • Open and add filed 'Label' under appropriate Screens configuration: at least in 'Create issue' and 'Edit issue'

enter image description here

Now, you can add label in UI and through API also.

user3787216
  • 291
  • 3
  • 4
  • Can this be done for the whole project, or does it have to be done for every Screen? I'd like to know before making this ask of our JIRA admin. Thanks! – Korzak Mar 15 '19 at 12:59
4

Well, I wrote that bit of the jira-python docs so I know it works. The problem as the error "It is not on the appropriate screen" suggests is that the standard Labels field is not on your Edit Screen configuration, or has been hidden in the field configuration being used by the project. Check you can edit the Labels field via the UI first.

mdoar
  • 6,758
  • 1
  • 21
  • 20
  • Thanks @mdoar. Come to find out after taking with the JIRA admin, labels was deactivated for that particular project. – propjk007 Oct 09 '15 at 17:36