Export WorkItem as XML while Saving
6 answers
How about using REST API?
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
You can request an XML representation of an workitem calling a URL like this:
rtc3.mvrec.local:9443/jazz/oslc/workitems/WorkItemNumber .xml
You also can save an workitem from a xml using REST API, using PUT requests. Read more...
But if you really want to use advisors/participant, you just need to do a normal java programming to read/write a xml file. You can even make a Class to represent your xml workitem with just the information you want. Using JAXB library will make your work easier.
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
You can request an XML representation of an workitem calling a URL like this:
rtc3.mvrec.local:9443/jazz/oslc/workitems/
You also can save an workitem from a xml using REST API, using PUT requests. Read more...
But if you really want to use advisors/participant, you just need to do a normal java programming to read/write a xml file. You can even make a Class to represent your xml workitem with just the information you want. Using JAXB library will make your work easier.
Thanks for this information bello,very useful.
What is the syntax for the URL though as I can't quite get it to work? Is 'oslc' the project name and does the WorkItemNumber need to be '1' or '001'. Also, if 'oslc' is the project name, how does the URL handle spaces between words?
Thanks.
Hi,
"oslc" is not the project name and the workitem number does not have format, it is the id (1,45,65876...) The URL I posted was an example that works with our internal server here. As we can see in
http://
Examples:
http://localhost:9443/ccm/oslc/workitems/1.xml
http://localhost:9443/jazz/oslc/workitems/1.xml
http://intranet:9443/ccm/oslc/workitems/1.xml
http://rtc.mycompany.com:9643:/ccm/oslc/workitems/1.xml
Thanks a lot for this info Bello.
Yes, by calling the URL i get Workitem XML, we could make a http post call and access the xml from the Advisor plugin if the work item is already saved. but to get the current workitem, will read the required fields from plain java code and write it as XML as your second point suggested.
Thanks
Yes, by calling the URL i get Workitem XML, we could make a http post call and access the xml from the Advisor plugin if the work item is already saved. but to get the current workitem, will read the required fields from plain java code and write it as XML as your second point suggested.
Thanks