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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,466,881
Community Members
 
Community Events
176
Community Groups

Script to set datetime to custom field only when ticket is assigned first time using scriptrunner sc

Edited

Hi, I need help to set datetime to customfield value when the issue is first time assigned only  using the scriptrunner. I tried builtin listener but could found anything Useful. On cloud i used jira builtin automation trigger ticket assigned but now on data cneter I'm stuck and need script to perform the above operation.

Thanks

1 answer

Hey @Wajahat Gul ,

If you issue will go from Unassigned to Assigned only once, perhaps you could try creating a custom listener that listens to the Issue Assigned event with the below script:-

def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "assignee"}

if(change) {
if (change.oldstring == null && change.newstring != null) {
//Set Date here
}
}

The script will check if the Assignee was changed from Unassigned to a specific user and then setting the date.

Of course, if ever your issue goes back to Unassigned and then assigned again, the date will change again.

Hope this helps.

Regards.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events