Export WorkItem as XML while Saving
![]()
Can we able to export/get the Current WorkItem in XML, i require this XML once the WorkItem is saved, how can we acheive this through a Advisor Plugin?
Thanks in advance |
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/ 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. |
![]()
I used the following RESTful url to get the xml for workitem 11
note that this is NOT project dependent a workitem is a workitem https://localhost:9643/ccm/oslc/workitems/11.xml note that in the results there are lots of fields you will have to retrieve individually.. Sam |
![]() Thanks for this information bello,very useful. 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 |
![]()
thank you very much for this bello, it needed https for it to work for me FYI but this is very useful. Henry
|
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.