Display Sub-columns for multiItemLink columns

Modified on Wed, 3 Sep at 1:02 PM

By default, when using a column of type multiItemLink (e.g., to show multiple linked Work Items), it is not possible to use sub-columns with dot notation like item.severity.


However, using the serverRender functionality in Risksheet, you can render custom sub-columns for both upstream and downstream multi-linked items — including displaying fields like Severity from each linked item.


If you don't know how to configure an upstream column to show multiple linked Work Items, please check this article.




TABLE OF CONTENTS


Imagine you have a Risksheet column that shows multiple System Requirements linked to a Risk item. Each System Requirement has a Severity field, which you’d like to display in a separate sub-column.


In case you want the "Severity" value to be rendered in one column together with the Item Link, check the following article: Customize the way Item Links are rendered


How to do it:

  1. Define a new column for “Severity”
  2. Make sure NOT to use the binding property
  3. Instead, use the following "serverRender" snippet

"serverRender": "<ol style='margin-block-start: -16px;margin-block-end: -16px;padding-inline-start: 16px;'>#foreach($linkedWorkItem in $item.fields().linkedWorkItems()) #set($sysReq = $linkedWorkItem.fields().workItem().get()) #set($typeId = $sysReq.fields().type().get().id()) #if($typeId.equals(\"systemrequirement\")) <li> $sysReq.fields().severity().render().withIcon(true).htmlFor().forFrame() </li>  #end #end</ol>" 


As a result, you will see a Severity column displaying values from all downstream linked Issues, sorted by ID.




You can apply a similar technique for downstream Work Items — for example, displaying all linked Issue WIs and their Severity values.


If you would like to have a multiItemLink downstream column "issue" shown in a separate column, check the following article, "Back Links" section: Configure Upstream Traceability Column

How to do it:

  1. Use this serverRender block in your custom column
  2. This query finds all Issues that link to the current item
  3. Results are sorted by ID.
"serverRender": "<ol style='margin-block-start: -16px;margin-block-end: -16px;padding-inline-start: 16px;'>#foreach($issueWi in $item.transaction().workItems().search().query(\"type:issue AND linkedWorkItems:${item.getReference().projectId()}/${item.getReference().id()}\").sort(\"id\")) <li> $issueWi.fields().severity().render().withIcon(true).htmlFor().forFrame() </li>   #end</ol>" 


As a result, you will see a Severity column displaying values from all downstream linked Issues, sorted by ID.




For any assistance, please don’t hesitate to reach out by submitting a ticket here.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article