Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes



6 answers

Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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

0 votes


Permanent link
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 sdetweil post, the URL depends three informations, 1) the server address 2) the server port 3) RTC application shortcut (in older versions it was "jazz", but in recent version it is "ccm").


http:// serveraddress : serverport/ rtc appname / oscl / workitems / number.xml


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

0 votes


Permanent link
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

0 votes


Permanent link
thank you very much for this bello, it needed https for it to work for me FYI but this is very useful. Henry

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Nov 22 '11, 8:20 a.m.

Question was seen: 12,386 times

Last updated: Nov 22 '11, 8:20 a.m.

Confirmation Cancel Confirm