Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to search issues using pure SOAP

Artem Pervenyonok July 13, 2011

I need to use pure SOAP in order to do some integration with Jira. The problem I have is that I can't generate correct SOAP request to search issue by a specific filter. I used WSDL to generate sample requests and used getIssuesFromTextSearch request. Here is the code:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:soap="http://soap.rpc.jira.atlassian.com">

<soapenv:Header/>

<soapenv:Body>

<soap:getIssuesFromTextSearch soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<in0 xsi:type="xsd:string">i8nn0pbo3q</in0>

<in1 xsi:type="xsd:string">reset=true&amp;&amp;pid=10190&amp;customfield_10005=active</in1>

</soap:getIssuesFromTextSearch>

</soapenv:Body>

</soapenv:Envelope>

The value for searchTerm I got from the permlink of the search I made in a browser (copy-pasted everything after "?"). I also tried "pid=10190&customfield_10005=active" and "customfield_10005=active" but with no result: I was either getting empty response or wrong issues in a response.


Can anyone hint me what I did wrong and how to get the same response as I'm getting in browser?

Thanks!

7 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
MattS
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.
July 13, 2011

Last time I looked at this I created a custom SOAP plugin that took a map of key=value constraints and converted them to a search string. It wasn't pretty.

~Matt

Artem Pervenyonok July 13, 2011

Is there any way you can share that plugin? Thanks in advance!

MattS
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.
July 13, 2011

Sorry, unlikely

Artem Pervenyonok July 14, 2011

Thanks anyway.

0 votes
Jobin Kuruvilla [Adaptavist]
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.
July 13, 2011

That's a pain. I will wait for Sohalil answer on RSS and then look at creating own SOAP Plugin if that also doesn't help!

0 votes
Artem Pervenyonok July 13, 2011

Thanks again. We need to use custom queries (like "Custom Field" equal to some value, and that value will be different for each request, so we can't create filters for each request), so pre-defined filter will not help :(

0 votes
Jobin Kuruvilla [Adaptavist]
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.
July 13, 2011

Not aware of an RSS search via SOAP. Maybe Sohalil is mentioning about the RSS feed?

Looking at you search parameters, searching based on a predefined filter maybe an option!

0 votes
Artem Pervenyonok July 13, 2011

Thanks for your replies! We're on Jira 3.*, so JQL is not our option (which is good, btw.). But can you plese refer me to any documentation how I can use RSS search through SOAP? I can't find this info...

sohail
Contributor
July 13, 2011

Sorry, I wasn't clear: you need to use a HTTP client and consume the XML/RSS found at:

<baseurl>/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?&tempMax=0

The comments in that feed should tell you how to filter on your custom fields.

Edit: I was wrong, it's not possible to filter on a custom field through the SearchRequest.xml interface. It's probably best for you to write a SOAP endpoint if you can.

Edit: I was doubly wrong, you can filter through RSS:

&customfield_<id>=<value>

AV Vehicle
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 23, 2011

Can you give a little more detail, because i want to implement that too and couldnt find anything on web.

Thanks in advance.

0 votes
sohail
Contributor
July 13, 2011

If you are on JIRA pre-4.0, then you want to use the RSS search because it allows a bit of filtering iirc. If you are on JIRA post-4.0, then use JQL.

0 votes
Jobin Kuruvilla [Adaptavist]
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.
July 13, 2011

getIssuesFromTextSearch simply takes a String and search for that String on the issues. It doesn't take search parameters and search using them.

You might want to look at JQL Search if you are on JIRA 4.x.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events