Document toolboxDocument toolbox

To learn more about Tempo products, please visit our Help Center. For support, see our Support Portal.

Cascading dynamic work attributes - Data Center

This article describes how to create cascading worklog attributes.
A worklog attribute is an additional information to the worklog itself. Tempo Timesheets for Data Center offers the possibility to create dynamic worklog attributes. Dynamic worklog attributes are dynamic because the values populated for this field are retrieved based on other information on the worklog (e.g. the worklog author or the issuekey). More information on dynamic worklog attributes can be found in our documentation.

Here we will show how the values in a dynamic dropdown field can be populated based on a selected in another worklog attribute.

Instructions

  1. Create a new dynamic worklog attribute.

In our example we want to make the worklog attribute “Worktype dynamic” dependent on the selected value of the worklog attribute “Worktype”.

2. In the configuration of the dynamic dropdown we specify the url of our script that is handling the outputted values to our dynamic worklog attribute. Something similar to.

http://{somePathToYourScript}?workattribute={_Worktype_}

It does not matter in what programming language your Data Center script is written but it is important that you pass the value of the selected value in the “Worktype” as a parameter.
As you see we wrap the value of the “Worktype” field into curly brackets. The key of the workattribute is always the name of the worklog attribute (during creation of the worklog attribute- a later change of the name will not affect the key of the field!) accompanied by “_”. All white spaces will also be erased from the key.
So for example, a worklog attribute with the name of “Worklog Category” would get the key

{_WorklogCategory_}

3. In your script you can handle the passed worklog attribute parameter and populate a list based on the value selected. The test code for this tutorial displays from 1-10 (in case if “Development” is selected), 11-20 (in case if “Triage” is selected), or 21-30 (in case if “Quality Assurance” is selected).

Cascading dynamic dropdowns are resource intensive and should not be used in Tempo reports when editing/displaying a huge amount of worklogs. Limit the date period to reduce the amount of worklogs being displayed.

You might also want to look into our exposed JS events as documented on our developer area.

You might need to inject your JavaScript code to listen on changes on the worklog attribute. The worklog attributes are displayed in a div with a id with the same name as the worklog attribute. e.g. id="_Worktype_”

https://tempo-io.atlassian.net/wiki/spaces/KB/pages/383615556

https://tempo-io.atlassian.net/wiki/spaces/KB/pages/270499978