Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel

On this page

Table of Contents
maxLevel2
exclude(On this page|Use case).*
stylecircle
typeflat
separatorpipe

UI Text Box
sizemedium
typeinfo

Use case

In this use case JWT is going to automatically log work as soon as an issue enters and leaves a specific status.

As soon as a user executes the Start Progress transition, we're starting our work. As soon as the user executes the Stop Progress transition, we stop our work and automatically log the time we worked on the issue.

Prerequisites

In order to make this use case work, we need to create one custom fields to store the time we entered the specific status. 

UI Expand
titleSet up the custom field
UI Steps
UI Step

Create a date time picker custom field

Name: Work Start Time

UI Step

Go to the Field configuration and set the visibility of the created custom field to hidden.


Configuration

UI Expand
titleSet up the Start Progress transition
UI Steps
UI Step

Add the Update or copy field values post function to the Start Progress transition.

UI Step

Target issue

Choose Current issue

UI Step

Fields

UI Steps
UI Step

Field

Choose Work Start Time

UI Step

Value

Choose Set field value manually

UI Step

Expression

Enter the following expression:

Code Block
linenumberstrue
{system.currentDateTime}
UI Expand
titleSet up the Stop Progress transition
UI Steps
UI Step

Add the Log work post function to the Stop Progress transition.

UI Step

Target issue

Choose Current issue

UI Step

Time spent

Enter the following expression:

Code Block
linenumberstrue
({system.currentDateTime} - {issue.cfnnnnn}) / {MINUTE}
UI Text Box
typeinfo

cfnnnnn is the field code for the Work Start Time custom field we've previously created.

Update the field code to the corresponding field code on your instance!

UI Step

Starting date-time

Enter the following expression:

Code Block
linenumberstrue
{issue.cfnnnnn}
UI Text Box
typeinfo

cfnnnnn is the field code for the Work Start Time custom field we've previously created.

Update the field code to the corresponding field code on your instance!

UI Step

Work description

You can enter a comment like this:

Code Block
linenumberstrue
Work started at %{issue.cfnnnnn} and stopped at %{system.currentDateTime}.
UI Text Box
typeinfo

cfnnnnn is the field code for the Work Start Time custom field we've previously created.

Update the field code to the corresponding field code on your instance!

UI Step

Additional options

UI Steps
UI Step

Remaining estimate

Choose Auto adjustment


Alternative implementation

UI Text Box
sizemedium
typeinfo

In the current implementation, the time between entering and leaving the In Progress status is being tracked as working time. So also non-working time will be logged (e.g. from 5pm to 8am the other day) even though nobody might be working on the ticket.

For this, a JWT calendar could be used. This way only the actual work time will be considered.

UI Expand
titleCreate a new calendar
UI Steps
UI Step

Head over to the Jira Administration → Manage apps → Jira Workflow Toolbox → Calendars.

UI Step

Hit Add calendar in the upper right corner.

UI Step

Name

Enter an appropriate name. For this use case we're going to use the name working-hours.

UI Step

Specification

Enter the following schedule:

Code Block
linenumberstrue
MON-FRI{
   08:00-17:00;
}
UI Expand
titleUpdate the Log work configuration from above
UI Text Box
typeinfo

Once the calendar is created, we have to update the configuration of the Log Work post function from above.

We only need to update the Time spent expression.

UI Steps
UI Step

Time spent

Enter the following expression:

Code Block
linenumberstrue
timeDifference({system.currentDateTime}, {issue.cfnnnnn}, "working-hours", LOCAL) / {MINUTE}
UI Text Box
typeinfo

cfnnnnn is the field code for the Work Start Time custom field we've previously created.

Update the field code to the corresponding field code on your instance!


For this expression the timeDifference() function was used.


Screenshots


Related use cases

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Parser functions, Label
sortByTitle
cqllabel = "use-case-workflow" and ancestor = "32211196"


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue

Page properties
hiddentrue
JWT feature

Workflow function

Log work

Parser functionstimeDifference()
Label
Page properties
hiddentrue

Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged