JIRA SOAP API questions

perny_nl August 13, 2012

This question is a copy of :https://support.atlassian.com/browse/JSP-134877

Support adviced me to post it here too.

Anyone can help (expecially for the first question)?

-----------------

Hi,
I'm running JIRA v4.2.4-b591#591.
I developed a Python script using SOAP API (suds) to connect to JIRA.

I have some questions I hope you can answer:
1) [the most important one]: how do you update an Affected Versions?

The following calls are perfectly working:

updateIssue("XXX-YY", [{"id":"priority", "values":[NNN]}])
updateIssue("XXX-YY", [{"id":"components", "values":[NNN]}])
updateIssue("XXX-YY", [{"id":"fixVersions", "values":[NNN]}])

Instead, the following ones are not working (and they don't throw any exception):

updateIssue("XXX-YY", [{"id":"affectsVersions", "values":[NNN]}])
updateIssue("XXX-YY", [{"id":"whatever", "values":[NNN]}])

2) Despite the documentation (http://docs.atlassian.com/rpc-jira-plugin/latest/com/atlassian/jira/rpc/soap/JiraSoapService.html) I could find out, by chance, other "hidden" methods like:

  • getIssueLinks(key)
  • getTransitions(key)
  • getHistory(key)
    Is there a way to retrieve "Labels" too? (of course I tried the obvious one [getLabels(key)] which didn't work)

3) Referring to point 2), I'm able to retrieve links, but I don't get the 'timestamp' or the 'author' (like it's happening with "getComments(key)" for example). Is there a way to retrieve those missing informations?

4) Again about "Links", is there a way to add or remove links?
With "Labels", for example, I could use the following trick:

updateIssue("XXX-YY", [{"id":"labels", "values":["A", "B", "C"]}])
updateIssue("XXX-YY", [{"id":"labels", "values":[]}])

Thanks a lot for your time,
Marco

4 answers

1 accepted

1 vote
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2012

JIRA Command Line Interface has support in some of these areas. Look through Documentation for specifics.

perny_nl August 13, 2012

Thanks Bob,
that was helpful...

Can you please confirm that addLabels/removeLabels are not implemented in 4.2?

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2012

Those should work on 4.2 I think - code says minimum of 4.2 though. Just don't test there any more :).

perny_nl August 14, 2012

> jira -s http://vlieg.intra.local/rpc/soap/jirasoapservice-v2?wsdl -u xxxx -p XXXXXX --action addLabels --issue "AAAA-11" --labels "whatever"

Remote error: Invalid data returned on REST request. Unexpected character (<) at position 0.

What I'm doing wrong?

perny_nl August 14, 2012

PERFECT! :)

Thanks a lot...

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 14, 2012

Use -s http://vlieg.intra.local , the client handles the service stuff.

0 votes
perny_nl October 14, 2012

This thread can be closed...

Thanks a lot for your answer, it really helped!

0 votes
perny_nl August 13, 2012

Ok, it took some time but I managed to find out the solution myself.
The correct name for the first question is "versions"

I feel pessimistic about the remaining questions...

0 votes
Dennis Kromhout van der Meer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2012
  • Regarding question 1, can you give me an actual coding example of what you've used in the past apart from "NNN" for affectsVersions? Can you please do the same thing for fixVersions?
  • Any luck with increasing the log level for SOAP to DEBUG?
  • Have you checked your XML output to see what methods are accepted? For example: https://jira.atlassian.com/rpc/soap/jirasoapservice-v2?wsdl</li<>>
perny_nl August 13, 2012

Hi Dennis,
thanks for your quick reply.

About question #1, the problem was in the name, not in the actual data passed. I knew that but I could not found out the correct name. Now I know: it's just "versions" :)

About the other questions, browsing the XML link you gave me, it's clear enough that there is nothing that can be used to retrieve labels or any extra information about links. Thanks, that was helpful although not solving my problem.

Cheers,
Marco

Suggest an answer

Log in or Sign up to answer