Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i set a label on an issue using the JIRA SOAP API

Tags:

soap

jira

Is there a way to set the "Labels" field for a ticket when creating or updating a JIRA ticket using the SOAP API? A search for "label" in the WSDL reveals nothing, and when getting a ticket using the API which I know has labels set, there is no indication in the result that a label exists.

like image 212
dcrosta Avatar asked May 20 '11 15:05

dcrosta


2 Answers

You can update the label of an existing issue using the field id 'labels'. Here is the code I'm using (C#):

public void LabelIssue(string issueKey, string label)
{
    RemoteIssue issue = jiraSoapService.getIssue(token, issueKey);
    List<RemoteFieldValue> actionParams = new List<RemoteFieldValue>();
    RemoteFieldValue labels = new RemoteFieldValue { id = "labels", values = new string[] { label } };
    actionParams.Add(labels);
    jiraSoapService.updateIssue(token, issue.key, actionParams.ToArray());
}
like image 165
EventHorizon Avatar answered Nov 09 '22 06:11

EventHorizon


I'm pretty sure there's no method to do this in JiraSoapService

http://docs.atlassian.com/rpc-jira-plugin/latest/com/atlassian/jira/rpc/soap/JiraSoapService.html

~Matt

like image 42
mdoar Avatar answered Nov 09 '22 06:11

mdoar