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,553,380
Community Members
 
Community Events
184
Community Groups

Custom field which will capture Date and Time stamp when given condition satisfies

Edited

All,

I need to create one custom field in JIRA which will capture Date and Time when value of other three fields set to '1'.

Details:

So whenever drop down of "Prioritization Business Impact", "Prioritization Severity" and "Prioritization Work Around" set to "1", new field should capture date & time of that moment.

How can I do this?

 

Thank You.

1 answer

1 accepted

1 vote
Answer accepted
Jia Jie
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.
Jun 03, 2021

Hi @Rakesh N ,

You can create a file in ScriptRunner Script Editor with the below script:

def cf1 = getFieldByName("CUSTOM_FIELD_NAME1").getValue()
def cf2 = getFieldByName("CUSTOM_FIELD_NAME2").getValue()
def cf3 = getFieldByName("CUSTOM_FIELD_NAME3").getValue()
def date = getFieldByName("DATE_TIME_CUSTOM_FIELD")

def currentDate = new Date()

if(cf1 == "1" && cf2 == "1" && cf3 == "1"){
date.setFormValue(currentDate.format("dd/MMM/yy h:mm a"))
}

 

Then, create a ScriptRunner Behaviour and add this created Script Editor file to your three Single Select List fields. Please remember to map the Behaviour to the correct projects and issue types.

 

Thanks for quick reply.

I could create Behaviour & mapped that to correct project and issue type.
But not understood part which says, add this created Script Editor file to your three Single Select List fields.

I will have to create one new custom field and then that field needs to add in this behaviour?

Thank You,
Rakesh

Jia Jie
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.
Jun 03, 2021

Hi Rakesh, 

What I mean is to apply the script to that three drop-down fields ("Prioritization Business Impact", "Prioritization Severity" and "Prioritization Work Around").

For example, create a file in the Script Editor named test.groovy. 

Then, edit your Behaviour > Add Fields (search for Prioritization Severity) > Add server-side script > Select the "File" tab > enter "test.groovy".

Repeat the steps for another two drop-down. 

That worked!

Thank you so much for quick response and clarification.

 

Regards,

Rakesh

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events