cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Translate the entire conversation x

How to use attribute "Outline Number" of Requirement Item in computed field expressions?

vjub58
6-Contributor

How to use attribute "Outline Number" of Requirement Item in computed field expressions?

Hi dear Community,

 

I want to use the Item Attribute "Outline Number" of Requirement Item in computed field. 

 

Example: I tried to write the computed filed expression like 'indexOf (<Outline Number>, ".") ' to know, whether Outline Number contains one "." (dot symbol). But I can't use the attribute name "Outline Number" per se, because it contains the blank symbol.

 

Therefore I need the property name for Outline Number. But this attribute is hidden and I can't see it in attributes' list of Tracker configuration, even if I turn the ticks "show hidden attributes" and "show property names" on.

 

Please help me to solve this problem. Thank you in advance!

ACCEPTED SOLUTION

Accepted Solutions
EvaBertalan
12-Amethyst
(To:vjub58)

Hello @vjub58 ,

 

The outline number of the work items in a tracker is not stored in any property.

That's why it is not possible to use it in computed field.

 

You need to use some other calculation to get the desired data.

E.g. in your example you can check if the work item has one and only one ancestor.

View solution in original post

8 REPLIES 8
EvaBertalan
12-Amethyst
(To:vjub58)

Hello @vjub58 ,

 

The outline number of the work items in a tracker is not stored in any property.

That's why it is not possible to use it in computed field.

 

You need to use some other calculation to get the desired data.

E.g. in your example you can check if the work item has one and only one ancestor.

vjub58
6-Contributor
(To:EvaBertalan)

Hi Eva,

 

thank you for your quick answer!

 

How can I check the number of ancestors in the item?

 

Thank you in advance!

EvaBertalan
12-Amethyst
(To:vjub58)

I've set a computed field with this formula: empty Parent ? "First" : (empty Parent.Parent ? "Second" : "Other")

 

EvaBertalan_0-1740745290760.png

 

This is the result:

EvaBertalan_1-1740745350416.png  EvaBertalan_2-1740745385349.png

 

 

 

vjub58
6-Contributor
(To:EvaBertalan)

Hi Eva,

 

thanks a lot for your answer!

 

It's very good solution for items' nesting level 2-3-4... unfortunately, in our project we have nesting levels (former "Object Level" in DOORS) up to 9. 😣

 

I found some infos about the function "ancestors()", that should return the list of item ancestors, and then "size(ancestors())" quasi should return the number of ancestors. But in doesn't work and the "computed" expression isn't evaluated properly in my codeBeamer version 2.1.0.0 (postgresql).

 

Could you please help me with the proper using of this function? Thanks in advance!

EvaBertalan
12-Amethyst
(To:vjub58)

To count the ancestor we would need to define a recursive loop in the computation. I couldn't find any solution for this, sorry.

vjub58
6-Contributor
(To:EvaBertalan)

Thank you anyway for the quick answer!

Hey, I was able to achieve what you were looking within a single tracker by creating a computed field with this expression:

 

empty Parent ? 0 : Parent.customField[1] + 1

 

 

where customField[1] is the property of my Ancestors custom field.

 

2-ancestors-multiple-parents.png

As you can see above, I've created two items as parents, and this example item with a parent that has a parent has a value of 2 in the Ancestors field.

1-ancestor-one-parent.png

 And now that it's parent has no more parents, the Ancestors field has a value of 1.


 

If you wanted this to work across trackers, or to be a bit cleaner of an expression, you could create an Shared Field for "Ancestors" and associate these individual tracker fields with this shared field like so:

creating-ancestors-shared-field.png

associated-tracker-field-with-share-field.png

Allowing us to use this new expression easily:

 

max(List(max(subjects.{subject | subject.Ancestors + 1}), empty Parent ? 0 : Parent.Ancestors + 1))

 


4-ancestors-across-trackers.pngFor this particular "Loram Ipsum 2" item, it has 4 ancestors - that being a User Story, with an upstream Feature, with an upstream System Requirements, with an upstream Customer Requirement.

 

This works within a single tracker as before by traversing the Parent, but also works across trackers by finding the max of all the Ancestors fields in the subjects tracker.

 

If you had other upstream trackers to include, it would only require an adjustment to the formula to include them in the max function.

 

 

max(List(max(subjects.{subject | subject.Ancestors + 1}), max(customChoice[3].{item | item.Ancestors + 1}), empty Parent ? 0 : Parent.Ancestors + 1))

where customChoice[3] is a custom dropdown of other upstream item references for this example.

 


Hopefully one of these solutions works for you, feel free to comment though if there are some additional needs related to this for whatever you are trying to accomplish!

vjub58
6-Contributor
(To:JosephM_SAI)

@JosephM_SAI , thank you so much for your contribution!

 

I will explore these solutions and hope it will work well for me. 👍

Announcements



Top Tags