EWM OSLC Query Search for link(chengesets(remote)) exist on workitems, what kind of parameters should I set?
We are investigating how to search for work items with Changeset (Remote).
I'm trying to search for OSLC Query, but I don't know how to set the same conditions as "exist" in the "EWM query".
what kind of parameters should I set?
As a guess, when I executed it under the following conditions, I was angry that "the conditions cannot be NULL."
Curl: -H "Accept: application/rdf+xml" -H "OSLC-Core-Version: 2.0"
https://jazzewm.com/ccm/oslc/contexts/_BABCgO8-EeuR4JcRG1xq9Q/workitems?oslc.where=oslc_cm:tracksChangeSet!=""
~~~~
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#" >
<rdf:Description rdf:nodeID="A0">
<oslc:message>Expected symbol: ", actual: null</oslc:message>
<oslc:statusCode>400</oslc:statusCode>
<rdf:type rdf:resource="http://open-services.net/ns/core#Error"/>
</rdf:Description>
</rdf:RDF>
It worked in Firefox RestClient.
Accepted answer
You can query for work items and then post-process the returned RDF to find any members of interest that do [not] have a specified property.
Best regards,
David
Comments
Thank you
Is that so
It is a way to change the verification of verification whether the result when you write '! = "" Is as expected.
I don't understand your question. EWM is complaining about the syntax of the query expression you specified in the
oslc.where
parameter. One thing I notice is that you have not URL encoded that parameter value - you should do so. An unencoded query expression of oslc_cm:tracksChangeSet!="" is dubious for several reasons. The sematics of comparing against an empty string may not be well defined. That property would normally have a URI value, and URI values should be enclosed in
<>
angle brackets. See section 7.2.2 oslc.where syntax in https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html#oslc.where.
I think the only safe way is to omit that condition from the query expression, or omit
oslc.where
and then post process the results.
I also note that you are not specifying olsc.select and this means that the set of properties of work item members of the returned LDPC is undefined, and might even be an empty set. It might also change from release to release, so any client that is dependent on the default set of properties is potentially fragile.If you require specific properties of work items to be included in the response, you should specify them with oslc.select.
Thank you for the detailed explanation.
And I'm sorry, there was no explanation in the previous comment.
I'm sorry,my English is not good.
Write the results of the trial.
I also thought that it would not work after reading the "oslc.where" reference.
In the CURL, I got a 400 error as I asked.
However, using Firefox's Addon "RestClient" returned the query results.
So I decided to create script by VBA.
I thought it would be a 400 error.
sample: using MSXML2
header accept:application/rdf+xml,oslc-core-version 2.0
GET https://jazzewm.com/ccm/oslc/contexts/_BABCgO8-EeuR4JcRG1xq9Q/workitems?oslc.where=oslc_cm:tracksChangeSet!=""""&oslc.select=dcterms:identifier,oslc_cm:tracksChangeSet
*don't URL encode
As a result, I confirmed that there was a response as expected.
<dcterms:title>ワークアイテム</dcterms:title>
<oslc:totalCount>487</oslc:totalCount>
<rdf:type rdf:resource="http://open-services.net/ns/core#ResponseInfo" />
Of course I don't know why.
It has been confirmed that all the IDs of the target work items match in another way.
I don't believe in this result,
I would like to use this method to achieve this purpose by using this.
I didn't know the importance of oslc.select, and I happened to add it according to my purpose.