Highlighted
Ted9 Absent Member.
Absent Member.
1265 views

Uploading a requirement's description using REST API

Jump to solution

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

 

0 Likes
1 Solution

Accepted Solutions
roddywang Absent Member.
Absent Member.

Re: Uploading a requirement's description using REST API

Jump to solution

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.)
0 Likes
2 Replies
roddywang Absent Member.
Absent Member.

Re: Uploading a requirement's description using REST API

Jump to solution

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.)
0 Likes
Ted9 Absent Member.
Absent Member.

Re: Uploading a requirement's description using REST API

Jump to solution

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. 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.