Configuration

How to create a SUTAJC field

To create a STAGIL User and Time Accounts (SUTAJC) field, you need to follow these steps:

  1. First, go to your Jira instance's "Settings → Issues → Custom Fields → Create Custom Field". A dialogue box will appear, and you can find the SUTAJC field under ‘Advanced’.

  2. Define the name for your field and add a description if necessary.

  3. Associate the field with the relevant screens. You must associate a field with a screen before it will be displayed. Click the “Update” button at the bottom of the page.

To start configuration for your SUTAJC field, follow these steps:

  1. Navigate to the "Custom Fields" page in your Jira instance by going to "Settings → Issues → Custom Fields".

  2. Find your custom UTA field in the list of custom fields and click on the three-dot menu to the right of the field.

  3. Select "Configure" from the dropdown menu, then choose "Contexts and default values".

  4. Select ‘Edit custom field config’ to open a configuration page:

image-20240212-164756.png
Field context & default value configuration page

Field configuration

Before beginning the configuration process, it is essential to carefully consider and decide on the setup for the employee file and related contract as described in https://stagil.atlassian.net/wiki/spaces/SUTAJC/pages/2196635649.

Calculating work logs

Configuration for calculation is set up within two tabs: Get Worklogs & Required Time:

Time Account Issues should be filled with a JQL query that returns the issues in which we would like to see the UTA field displayed.
For example, in our use case, the JQL specifies that the UTA field will be displayed in the ‘Employee’ issue type of project ‘HR’.

User Field specifies whose work logs will be calculated.
In our case, we would like to calculate the work logs of an employee file assignee.

Tempo billed hours: By default, the field calculates work logs from Jira’s default custom fields. To calculate based on Tempo work logs, mark the checkbox and complete authorisation with the Tempo app as specified in https://stagil.atlassian.net/wiki/spaces/SUTAJC/pages/2207809538

Calculation Days & Time: this is a scheduler in which you can set up how often the calculation is triggered.

image-20240212-185844.png
‘Get Worklogs’ tab

User Contract Link: To perform a calculation, the field needs to pull conditioning values from a contract. A link type should be specified to help the field understand which of the related issues is the contract in the User Contract Link field.

Contract Required Time: Select the text field that is associated with the linked contract and has the contracted hours as a value.

Contract Start & End: Select the date field that is associated with the linked contract and store the contract start & end.

Overtime Payout Calculation

This field accepts a JQL query to define issues from which the app pulls the value from the ‘Original estimate’ field and subtracts it from the value in the current SUTAJC field.

For instance, if an employee's overtime hours are calculated at a different rate than their contracted hours, they should not be included in the time balance of the SUTAJC field. In this scenario, the employee can create an issue (e.g. type = Overtime) and update the default 'Original estimate' field with the number of extra hours. Meanwhile, the SUTAJC configuration can be changed to exclude logs from the 'Overtime' issue from the calculation:

type = Overtime AND reporter = ${issue.reporter.accountId}

If the contract issue is linked to the employee file by an Advanced Link from our app STAGIL Assets, a different configuration is required to specify the link.

In this case, the link would have to be specified with a Jira expression:

issue.properties['sajc-field-123']['123'].map(key => { let wcIssue = new Issue(key); return { accountId: issue.assignee.accountId, start:wcIssue .customfield_10040+"T00:00:00", end: wcIssue .customfield_10041+"T23:59:59", workload: JSON.parse(wcIssue.customfield_10045) }} )

where 123 in sajc-field-123 is the Advanced Link ID, and user, contract dates and workload are recorded as wcIssue .customfield_10041 with a specified field ID.

To aggregate only the billed time, the complete expression should be formulated as follows:

issue.properties['sajc-field-123']['123'].map(key => { let wcIssue = new Issue(key); return { accountId: issue.assignee.accountId, start:wcIssue .customfield_10040+"T00:00:00", end: wcIssue .customfield_10041+"T23:59:59", workload: JSON.parse(wcIssue.customfield_10045) useBilled: true } })

 

© 2023, STAGIL