Save markup information in Primary Text attribute in DNG 7.0.3 via API
In DOORS Next Generation 7.0.3 you can put markup information in the Primary Text/Contents column. For example, can color text, underline text, strikethrough text, specify the color of text, etc (see image below for example). Is it possible to specify markup information for the Primary Text/Contents of an artifact via an API call, and if it is possible to do so, then how? I know that there is this Using OSLC capabilities in the Requirements Management application article which provides examples for how to update an artifact's attributes, but it doesn't specify if it is possible to set markup information. , and
Accepted answer
You need to use HTML markup inside the jazz_rm:primaryText field.
If you fetch the Primary Text for an existing artefact that contains markup you'll see how it's done
Comments
Ok, I'll take a look at that, thanks. I have 2 more questions.
- If an artifact's attribute is read only through the GUI, can that attribute be updated via the API? For example the Modified By attribute stores the name of the person who last updated the artifact and can't be updated via the GUI since it's automatically updated based on the user that last updated the artifact; would it be possible to update attributes like these via the API?
- I'm assuming that markup can't be applied via the API to attributes that have a data type that isn't a string (for example, date type attributes or attributes that have enumerated values)? And I'm assuming that if the attribute type is a string then markup could be applied to it via the API?
1. Nope - read only is read only. That includes permission based read only as well.
2. Correct and, in fact, you have to use the enumeration internal ID when setting it. And no, mark up is only available in Rich Text attributes - in other words the Primary Text, and the content of a Comment
1 vote
Thanks for your response. I have a few more questions.
- Since Primary Text and Comments are the only rich text attributes, is it possible to define a new attribute that is a rich text attribute, and if so how? I know how to create a new attribute, but "rich text" as a data type isn't listed. The only data types listed for an attribute are integer, float, boolean, date, time, date time, string, duration, and user.
- Is there a limit for how much text can be stored in the "Primary Text" attribute, and if so, what is the limit?
1. No - there's no Rich Text data type available, only plain text
2. Primary Text has a large limit - I think it's in the range of 64k or 256k?
1 vote