Skip to main content
12-Amethyst
November 2, 2023
Question

How to get the displayIdentifier from a task name

  • November 2, 2023
  • 1 reply
  • 2803 views

Hi, I am trying to add a column to a custom report that collects Task data. The new column will show the highlighted number (in this example: "00041") in the task name/description. 

The debug says this field is ColumnID: "displayIdentifier" coming from Row Object: wt.change2.WTChangerRequest2. 

MR_10589254_0-1698952429844.png

Is this number only available in the ChangeRequest2 table? 
If so, how can it be linked to Work Item?

TIA!

 

 

1 reply

14-Alexandrite
November 2, 2023

Hello,

 

The 'Work Item' task is linked to its subject via the 'Primary Business Object' join.  So you are correct that the 'Number' of the Change Request does not exist on the 'Work Item'.  You would have to introduce the 'Change Request' table into the query and connect with that join.  You can then include the 'Number' field of the Change Request in your 'Select' definition.  Depending on your situation you may or may not desire an outer join so that Change Requests without any Work Items show up in the result.  Here are some helpful links:

 

Tables and Joins from WHC: https://support.ptc.com/help/windchill/whc/whc_en/#page/Windchill_Help_Center%2FQBTablesAndJoinsAdd.html%23 

 

Generally awesome resource for query builder scenarios: Resource for reporting - PTC Community

 

Specific entry in above resouce page related to work items, voting, and primary business objects.  This example does have the join that I've described and much more to help you get started: https://www.ptc.com/en/support/article/CS130932 

12-Amethyst
November 9, 2023

Thanks for the information @aaronjlarson

Do you know if there is a parent table that is over the various types of tasks (like 'Primary Business Object' is for 'Work Item') that could also contain this number, instead of needing to get every task types table? I am being asked to create a column for this "task number" for all types of tasks not just Change Requests. 

HelesicPetr
22-Sapphire II
22-Sapphire II
November 9, 2023

Hi @mariaSutton 

So you can use condition if the primaryBusObj instance of WTPart or EPMDoc, or Change Tassk, or Change Order and get the value from that object.. 

You always needs to retype the primaryBusinessObject to correct type if you want to work with them..

 

PS> there is not general table for primaryBusinessObject - this object can be any object in the system and each object type usually has own table and APIs.

There are several type groups as Persistable that can be used on most of the object types. 

 

PetrH