I have tried both the REST API and SOAP API to update the labels. On the REST API I tried to use a PUT /rest/api/latest/issue/XXX-1234 with the following body:
{ "update": { "labels": [ { "remove": "LabelX" } ] } }
But it returns an HTTP 400:
{"errorMessages":[],"errors":{"labels":"Field 'labels' cannot be set. It is not on the appropriate screen, or unknown."}}
I understand that the error is telling me I need to put the labels on the screen itself, however doing so across all of the various projects would be quite time intensive.
On the SOAP API I tried to use PowerShell to do the same:
$Credential = Get-Credential -Message "JIRA Credentials" $Proxy = New-WebServiceProxy -Uri http://xxxx/rpc/soap/jirasoapservice-v2?wsdl $Token = $Proxy.login($Credential.GetNetworkCredential().UserName, $Credential.GetNetworkCredential().Password) $RemoteFieldValues = @() $RemoteFieldValue = new-object Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1c_soap_jirasoapservice_v2_wsdl.RemoteFieldValue $RemoteFieldValue.id = "labels" $RemoteFieldValue.values = @("LabelXY") $RemoteFieldValues += $RemoteFieldValue $Proxy.updateIssue($Token, "XXX-1234", $RemoteFieldValues)
But it returns the issue data set with an HTTP 200, but without the labels listed and no change to the underlying issue.
What methods have others used to update labels (add/remove) across many issues / projects?
Community moderators have prevented the ability to post new answers.
SOAP is not an option because it will be removed in JIRA7. For REST, you need to have the field on screen. Or you can create a REST plugin that exposes a new method, without the screen check.
I understand that the error is telling me I need to put the labels on the screen itself, however doing so across all of the various projects would be quite time intensive.
How many screens are we talking about? Surely you don't have a different screen for every single project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.