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

JQL for issues commented by assignee within 7 days after been assigned

Pengshan Dai September 13, 2024

Dear Community,

I'm trying to filter the issues got responded <7 days by assignees after they are been assigned. Comments or change status consider as response to the issue.

Within an issue workflow, there might be two assignees in total.

I have installed ScriptRunner, but can not figure out what JQL to complete this function. 

Thanks!

1 answer

0 votes
Cristian0791
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 13, 2024

Hi Pengshan,

 

You can try the groovy script:

issueFunction in issueFieldMatch("", "assignee", ".*") AND issueFunction in dateCompare("", "issue.history[commented, status changed] <= assignee[date] + 7d") 

Pengshan Dai September 13, 2024 edited

Hi Cristian, thank you for your help.

I tried it in ScriptRunner Enhanced Search:

 

issueFunction in issueFieldMatch("project = AMSELC", "assignee", ".*") + issueFunction in dateCompare("project =AMSELC", "issue.history[commented, statuschanged] <= assignee[date] + 7d")

 

 

 

But got error:

 

 

Found '.history[commented,statuschanged]' instead of .clearTime()

 

Did I do anything wrong?

Pengshan Dai September 13, 2024

How to specify the person who commended shall= assignee?

Cristian0791
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 13, 2024 edited

Can you please try: 

(issueFunction in issueFieldMatch("project = AMSELC", "assignee", ".*")
AND (issueFunction in commented("after -7d") OR status CHANGED AFTER -7d))

 

 

This approach gets you closer to filtering issues where assignees responded (via comment or status change) within the timeframe you want.

Cristian0791
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 13, 2024

issueFunction in commented("by assignee after -7d")

 

This query will return issues where the assignee made a comment within the last 7 days.

Pengshan Dai September 15, 2024

Hi Cristian, thanks a lot for your reply. Unfortunately I got return,

Function 'commented' does not exist

I am using ScriptRunner Enhanced Search, do I need to download any extra app?

Best,

Cristian0791
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 15, 2024

Since you're using ScriptRunner Enhanced Search, you don't need to download any extra app. The commented function should work as part of the functionality provided by ScriptRunner.

Check Commented Function: Verify that the commented function is correctly enabled in your instance by going to Administration > Add-ons > ScriptRunner > Built-in Scripts and ensuring the function is available.

Like • Pengshan Dai likes this
Pengshan Dai September 16, 2024

I will check this with our administrator for JIRA. Thank you for your hint!

 

Ryan J Stagg
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 17, 2024

@Cristian0791 is it possible you're using Jira Data Center here?  Even the docs for ScriptRunner Cloud say Commented is not supported:

image.png

 

Pengshan Dai September 18, 2024

How can we add Commented Function? 

Cristian0791
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 21, 2024

Oh, got it! You're right, I’m using Data Center. Sorry for the mix-up!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Jira Events