Forums

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

Get issue id of last created issue, and check issue type

-
Contributor
November 30, 2020

Referencing the round robin assignment script from adaptavist library:https://library.adaptavist.com/entity/round-robin-assign-issue-to-users-in-a-certain-project-role, I want to get the last issue created in a project, but i also want to focus in on a certain issue type. 

Here's what I changed in the script:

def lastIssueIdWithAssignee = issueManager.getIssueIdsForProject(issue.projectObject.id)
.sort()
.reverse()
.find {issue.getAsString("issuetype") == "Certification" }

So with this, I thought I'd be able to find the last Certification issue created in that project, but this doesn't seem to be the case...because the assignee keeps defaulting to the first user listed in the user key array.

Is there anything wrong with the change I made to the script?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Leo
Community Champion
October 23, 2020

Hi @neeta jain

You can get current date in script using below snippet

today = new java.sql.Timestamp(new Date().getTime())

using this you can compare today's date with end date and do the calculation

 

BR,

Leo 

TAGS
AUG Leaders

Atlassian Community Events