How do you submit category fields in a new work item post?
I need to create a post command to use to create new work items and this is my first time having to submit data for a category field. I don't know how to properly format the xml and I would love to see an example of it or some type of how-to guide that I haven't been able to find yet.
|
5 answers
The easiest way to get an example is to GET an existing work item and examine its XML content. You can start with these articles.
Comments
Shawn Carroll
commented Apr 06 '17, 10:52 a.m.
I've done that, but the filed against entry only lists a web address that contains nested xml content. I copied that nested xml content into my POST and inserting the submitted information into the fields, but that didn't work. I don't know how the POST is supposed to be formatted to transfer the filedAgainst fields to RTC.
|
Hello,
From your question, I could not tell whether you are creating a new work item with a REST client or programmatically.
There is a OSLC java client sample code at http://git.eclipse.org/c/lyo/org.eclipse.lyo.client.git/tree/org.eclipse.lyo.client.java.sample/src/main/java/org/eclipse/lyo/client/oslc/samples/RTCFormSample.java .
It shows how to specify the property category.
Please start from there, somewhere from line 230 to 246. I will look into it this afternoon and I try to provide more details by tomorrow morning.
Best regards,
Jean-Luc
|
Hello again,
It looks simple to understand.
The sample code says: look into the service provider RDF document.
Identify the creation factory node.
It specifies the expected work item resource shape.
The resource shape document comes with one or many properties "file against": URI = RTC_NAMESPACE + RTC_FILED_AGAINST.
We would need to select one of the allowed values. Let's called it "values[1]" . Then please extend your Work item RDF document (or java object) with a new statement:
(RTC_NAMESPACE + RTC_FILED_AGAINST, values[1])
Constant values:
RTC_NAMESPACE = "http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/";
RTC_FILED_AGAINST = "filedAgainst";
I hope it helps.
Best regards,
Jean-Luc Johnson, Airbus
Note: if you like my answer please like it (thumb up). I will appreciate.
Comments
Shawn Carroll
commented Apr 06 '17, 2:01 p.m.
I'm using a REST client via PERL scripts to submit this POST. I'm not familiar with the documents that you mentioned though.
|
Fine,
Please follow the instructions in my second post. The code is well commented. You should be able to reproduce the same instructions into Perl.
Let me know how far you have been.
|
Shawn, I'm not quite sure why you could not do it, as it is quite simple. Whether you use Perl or not should not matter. For example, if I POST to the below URL
"OSLC-Core-Version: 2.0", "X-Jazz-CSRF-Prevent: <actual JSESSIONID value>" and "Content-Type: application/rdf+xml"
Comments
Shawn Carroll
commented Apr 07 '17, 10:08 a.m.
I don't know how you created that rdf:resource address value, or how you filled in the fields contained within it.
Donald Nong
commented Apr 09 '17, 9:10 p.m.
In a previous comment, you said that "I've done that, but the filed against entry only lists a web address that contains nested xml content", what is exactly what it is, the category. If you want to get all the available category values, check out the below post.
Shawn Carroll
commented Apr 10 '17, 10:06 a.m.
My issue is that I don't want to get the values. I'm trying to create a new work item and I need to set a field within that address. I don't know what the format of the xml needs to look like to set a field within that web address.
Donald Nong
commented Apr 13 '17, 6:17 a.m.
I don't really understand what you try to do. The Filed Against attribute is mandatory and you have to set a value to it when creating a work item. You keep using the term "address" which only confuses yourself. "Resource URI" is a more proper term. You should consider the category value as an identifier, rather than an HTTP URL.
Shawn Carroll
commented Apr 13 '17, 11:08 a.m.
I've never manually set the Filed Against attribute when creating work items. I don't know how to modify the resource URI and set the Filed Against attribute in xml when creating a new work item.
Donald Nong
commented Apr 13 '17, 10:44 p.m.
So you haven't really read my answer and the subsequent comments then. If you have difficulties in understanding the resource URI, I suggest you practice updating an existing work item by modifying its Enumeration attributes (Priority, Severity and etc).
I've read them, they just weren't helpful to me in understanding how to solve my issue.
showing 5 of 7
show 2 more comments
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.