It's all about the answers!

Ask a question

How can print the data like id, type and status of an artifact


anil konakalla (10324) | asked Oct 17, 4:41 a.m.
Hello Team
Could you please suggest to print the data like id, type and status of an artifact  using the view data sources...
in the view datasource we got the schema using the res api url and the schema is as follows

<rrm:headers rrm:totalCount="10">
    <field:name field:fieldId="1" field:width="45">ID</field:name>
    <field:name field:fieldId="2" field:width="758">Primary Text</field:name>
    <field:name field:fieldId="3" field:width="80">Artifact Type</field:name>
    <field:name field:fieldId="4" field:width="60">Classification</field:name>
    <field:name field:fieldId="5" field:width="60">Status</field:name>
    <field:name field:fieldId="6" field:width="24">Comments Count</field:name>
    <field:name field:fieldId="7" field:width="200">Satisfies</field:name>

How can we print those valuse either by using the script
if
( ["fieldId"]  == "1" &&
 ["isContent"] == "false"  &&
[ "type "] == "text")
{
dataSource[ "_value"];
}
else
{
  " ";
  }
but above is not going to print the values or else any condition required to print using the above schema
could you please suggest


Thank you
Anil

One answer



permanent link
M K (30338) | answered Oct 18, 4:13 a.m.

i'm not really sure i understand your question, but that "rrm:headers" section maps the view column names (attributes, tags, and links) to field ids. so in your example, ID is mapped to field id 1. then in the "ds:artifact" elements, under the "rrm:fields" section, there are elements with those field ids with the actual data. in your program, you have to read that header section first and make a little mapping table then as you read the actual data you can use it to know what it is.

Your answer


Register or 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.