Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation made to calculate total project hours via Atlassian Knowledge Article not working

Faizan Iftikhar
Contributor
September 22, 2022

Dear Members,

Good Day!!

I have made rule with the help of Knowledge Article but not working, PFB link.

Have converted 99 Hrs. to seconds but the condition not matching. PFB screenshot... Need your input to settle it, please. Using Jira Service Management-SAAS

 

https://confluence.atlassian.com/jirakb/how-to-get-total-time-logged-into-an-issue-using-automation-for-jira-1115672355.html

 

12.png

1 answer

0 votes
Bill Sheboy
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.
September 22, 2022

Hi @Faizan Iftikhar 

What does not work as you expect?  For example, if you write that smart value to the log before the condition test, does it contain a value greater than you expect?

I tried this and it worked for me.

Kind regards,
Bill

Faizan Iftikhar
Contributor
September 22, 2022

Hi @Bill Sheboy 

Thanks for your reply...

Objective:

When project crossed hours limit email generated

Problem facing: 

Have set rule limit of 99 hours in seconds, have tested the rule by adding hours in project but it is not generating email notification . PFB snap for reference

 

11.png

Bill Sheboy
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.
September 23, 2022

That is curious...

Would you please post an image of the details of the Advance Compare Condition?

And, perhaps add a statement before the condition to write to the audit log the sum value: {{triggerIssue.worklog.timeSpentSeconds.sum}}

Faizan Iftikhar
Contributor
September 25, 2022

hi @Bill Sheboy 

 

Thanks for reply..

Sure, PFB snap of condition. have already added above mentioned condition in Advance compare...

 

BR,

M Faizan

 

10.png

Faizan Iftikhar
Contributor
September 26, 2022

Hi @Bill Sheboy 

Stay Safe!!

Have checked thoroughly and came to know that this statement is precisely for issue exceed limit only i.e. If issue exceeds hours limit then fire an email.

I am looking for, If hours of particular Project is exceeds limit then intimate via email.

Can you please help me out against hours exceeds limit then shoot an email.

Thanks in advance.

 

BR,

M Faizan

Faizan Iftikhar
Contributor
September 26, 2022

@Manon Soubies-Camy  : Please help to find solution, that would be Great!! 

" If hours of particular Project is exceeds limit then intimate via email."

Thanks

Bill Sheboy
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.
September 26, 2022

As you want to find this for the entire project, not for one issue, I suggest trying this:

  • write a JQL statement to find the issues you want to check/sum up
  • change your rule trigger to scheduled and run the rule periodically, such as once per day
  • instead of using one issue, use the Lookup Issues action with your JQL
  • then test the value using the following:
{{lookupIssues.worklog.timeSpentSeconds.sum}}
Faizan Iftikhar
Contributor
September 27, 2022

Hi @Bill Sheboy 

Appreciate your reply...

I hope, have incorporated correctly as Automation is not working.

13.png

 

14.png

16.png

Bill Sheboy
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.
September 27, 2022

Two changes to make: remove the JQL from the scheduled trigger, and add a Lookup Issues action to use that JQL before your condition test.

Scheduled triggers may be used with or without JQL to gather issues.  For your use case, we want "no JQL" so the lookup can handle the issues.

Faizan Iftikhar
Contributor
September 27, 2022

Thanks for reply @Bill Sheboy 

if i am removing JQL form the scheduler it ended with error PFB.

 

10.png 

Bill Sheboy
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.
September 28, 2022

Did you also add the lookup issues action, as I cannot see the remainder of your rule.

That error seems to indicate that is not present yet.  Please see my earlier responses for details.  Thanks!

Like Faizan Iftikhar likes this
Faizan Iftikhar
Contributor
September 30, 2022

thanks for connecting @Bill Sheboy 

Sharing snap , hope it covers the whole scenario

09.png

Bill Sheboy
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.
September 30, 2022

Please modify the rule like this to access the issue data...

  • trigger: your scheduled trigger
  • action: lookup issues with the JQL to find them
  • advanced compare condition: your test on the worklog from the lookup
  • ...
Faizan Iftikhar
Contributor
October 3, 2022

Hi @Bill Sheboy 

Truly appreciate your time and patience...

  1. I have put as lookup issue with JQL and it ended with no error PFB snap, thanks
  2. Now the Problem is in Audit log it shows success but no action performed, The threshold to raise trigger is 1 hour which is not working
  3. When project hours reached to 1 hour then send mail

 

Point # 1.png

 

POINT# 2

Point # 2.png

 

Thanks

BR,

M Faizan

Bill Sheboy
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.
October 3, 2022

Two things to check: 

Try running that JQL manually with advanced issue search (outside of the rule) to confirm it returns all of the issues you expect.

Next in the rule, after the Lookup Issues action, write the value for the sum of the time to the audit log.  Does it match what you expect for those issues?

Faizan Iftikhar
Contributor
October 4, 2022

Hi @Bill Sheboy 

Thanks for reply...

Point #1 : It is also running in other Rule and works fine. If I Validate query it shows correct number of issues

 

Point #2: Can you please elaborate " write the value for the sum of the time to the audit log "

Appreciate your time , thanks

 

BR,

M Faizan

Bill Sheboy
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.
October 5, 2022

After the lookup issues action, add a write to the audit log to check the value:

{{lookupIssues.worklog.timeSpentSeconds.sum}}

Suggest an answer

Log in or Sign up to answer