Is there a way to use the startofmonth() with the worklogged function[addon-com.onresolve.jira.groovy.groovyrunner]

Gulfam Amin ul Haq
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.
August 18, 2014

when trying to use the worklogged function

issueFunction in workLogged( "after 2014-08-01", "before 2014-08-30" )

is there a way to use the startofmonth() and endofmonth() with it for e.g. like

issueFunction in workLogged( "after startofmonth()", "before endofmonth()" )

3 answers

1 accepted

0 votes
Answer accepted
Gulfam Amin ul Haq
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.
August 21, 2014

Not sure who Downvoter is

But the workarounds which have been suggested have one flaw

1) it has to be a per person thing since you cannot use the group or role level

2) if an issue has a work log 2 months old and the person recently made a change to comment on it it would show up

3) the workaround can be implemented with jiras existing columns

updated > startofmonth() and updated < endOfMonth() and timespent is not EMPTY

JamieA
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.
August 24, 2014

True enough. I don't really have a better workaround, I would probably use a service to programatically update the query every month. You can log a ticket for those functions to start the time functions too...

2 votes
Alex Corsun August 19, 2014

I needed that function too. But as stated in documentation https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+JQL+Functions#ScriptedJQLFunctions-workLogged(worklogquery) you can use either date YYYY-MM-DD or date expressions e.g. w, d, h, m.

You can also try to sort issues if they have been resolved during the period but it's not very precise:

CHANGED after startOfMonth(-1) before endOfMonth(-1) AND issueFunction in workLogged("by assignee")

JamieA
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.
August 21, 2014

Apart from you got the syntax a bit wrong, why do you say it's not precise?

Gulfam Amin ul Haq
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.
August 21, 2014

if an issue has a work log 2 months old and the person recently made a change to comment on it it would show up in that query which you dont want since the worklog is old

Alex Corsun August 21, 2014

By "not very precise" I mean this function is good when you have worklogs only in one period but if you have a big tasks with several worklogs - you will get it both in current and previous periods. For example, if you have a task with worklogs on July 31 and August 1 - it will be shown both in searches for this month (using startOfMonth()) and previos one (using startOfMonth(-1))... Still for me that wasn't a big problem.

Alex Corsun August 21, 2014

And Jamie thank you for this awesome plugin.

1 vote
JamieA
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.
August 21, 2014

Gulfam, unfortunately it's not possible.

Alexander - that seems like a good workaround, with a slight adjustment:

updated > startofmonth() and updated < endOfMonth() and issueFunction in workLogged("by admin")

Downvoter - what's wrong with that?

Alex Corsun August 21, 2014

Yes, my syntax is wrong... It should be:

status changed to "Complete" after startOfMonth(-1) before endOfMonth(-1) AND originalEstimate != 0 AND issueFunction in WORKLOGGED("by user.name") AND issueFunction in aggregateExpression("Estimated", "originalestimate.sum()", "Work Logged", "timespent.sum()")

...and that will make a report if employee user.name have managed to meet original estimates on completed tasks last month.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events