Quality Center / ALM Practitioners Forum

Uploading a requirement's description using REST API

Go to solution
Valued Contributor.

Uploading a requirement's description using REST API



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.





Honored Contributor.

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.)
Valued Contributor.

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.