Uploading a requirement's description using REST API (547 Views)
Reply
Occasional Advisor
Ted9
Posts: 16
Registered: ‎06-25-2012
Message 1 of 3 (547 Views)
Accepted Solution

Uploading a requirement's description using REST API

Hello, 

 

When I pull up a requirement using a URL (http://{server:port}/qcbin/rest/domains/{domain}/projects/{project}/requirements/465), 465 being the requirement ID number, I get an XML file representing the requirement. If I look up the field where the description is (I believe its <Field Name="req-comment">), it shows the description of the requirement written in html. So when I go to my application and try to create some html to upload, it doesnt show up in ALM!

 

The whole intent is to upload a description with a certain format.

 

Does anybody know what the problem is? Is this even possible?

 

If anybody can help, it would be great.

 

Thanks!!

Ted

 

Trusted Contributor
roddywang
Posts: 138
Registered: ‎07-07-2009
Message 2 of 3 (536 Views)

Re: Uploading a requirement's description using REST API

Hi Ted9, two points:

 

1. Description field is almost a common field for all entities, so in REST, its field name is "description" while not "req-comment" in your case. I suggest that you can get an entity first and later you can find all the fields' name instead of guessing it.

2. To assign a value with html tag in xml, you need to do like below example. Use <![CDTA[ your value ]]> to specify that you have a html format value.

<Field Name="description"><Value><![CDATA[<html><body><div align="left"><font face="Arial"><span style="font-size:8pt"><b>cba</b></span></font></div></body></html>]]></Value>

 

Hope it is helpful for you.

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
Occasional Advisor
Ted9
Posts: 16
Registered: ‎06-25-2012
Message 3 of 3 (520 Views)

Re: Uploading a requirement's description using REST API

Hi roddywang!

 

Thanks again for replying to my post. You seem to know a lot about the REST API. :)

 

Using <![CDATA[<html>...</html>]]> worked perfectly. THANK YOU. 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.