Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,369,454
Community Members
 
Community Events
168
Community Groups

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

Edited

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

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

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

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}}

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

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

@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

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}}

Hi @Bill Sheboy 

Appreciate your reply...

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

13.png

 

14.png

16.png

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.

Thanks for reply @Bill Sheboy 

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

 

10.png 

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

thanks for connecting @Bill Sheboy 

Sharing snap , hope it covers the whole scenario

09.png

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
  • ...

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

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?

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

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