Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Advice needed - Time tracking process on JSM

Berat Altunhan April 30, 2024

Hello,


I will explain what I want to do through a scenario. This scenario takes place on the Jira Service Management product.

Company A is a consulting firm and sells packages to its customers over the hour. For example, it sells a 20-hour consulting package in May and the customer can get 20 hours of support from company A in May. Company A wants to keep the 20 hours of support on Jira, and when a request is received from each customer, it wants to enter the number of hours it solved these requests -time tracking- on Jira, subtract this from the total package received (20 hours) and send this information via an automatic mail when the job is "Done".


How can I set up this process on Jira Service Management? I am waiting for your advice.

 

1 answer

0 votes
Adaeze_Jude_HEROCODERS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2024

Hello @Berat Altunhan ,

You can use Clockwork API to automate this process using an automation rule.

First, I would advice a scenario where every customer is assigned a project.

The trigger for the automation should be when Work is logged. After this, a Web request is sent using Clockwork API that allows you to specify the ProjectKEY and the start time, as below:

https://api.clockwork.report/v1/worklogs?starting_at={{now.startOfMonth.jiraDate}}&project_key=HELP##)}}

the starttime specifies the beginning of each month so you can get the totaltimespent in seconds for that month

The webrequest should be as below:

Grammarly.Desktop_YK6e5yN3Vf.png

Next, add an if/else condition. In the If condition, check that the webresponse status category is a success. Next, create a variable to save the sum on the webresponse.timepsent, as shown:

chrome_4H8v4zqrtC.png

Next, create another variable to save time in hours as shown:

chrome_lUGO4hQXdd.png

Next, create a variable to save the time left, this is in your case 20h-timespentHours, as below:

chrome_03DNXUTKAa.png

 

After identifying your variable, you can then add an action to send an email to a desired email address as below:

chrome_iyemmunjfu.png

To use this rule for more than one project, first, you can replace the web request as below:

https://api.clockwork.report/v1/worklogs?starting_at={{now.startOfMonth.jiraDate}}&project_key={{triggerIssue.key.substringBefore("-")}}


 then for the email to be sent to different email addresses, create a custom field to store the email address of every customer on their respective issue and you can dynamically reference that email with {{triggerissue.[Custom Field].id}}.

Also, to avoid the rule from running every time a user logs time, you can change the trigger for this issue to be scheduled.

I will be happy to work with you on this, please reach out to us here if you have further questions.

 

Wojciech Wardaszko _HeroCoders_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2024

@Adaeze_Jude_HEROCODERS @Berat Altunhan 

let's just add that to use our API you'd need to install either Clockwork Free or Clockwork Pro.

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events