I want a text field to capture the reason from users only when an Issue type's Due Date is changed to a latter date,
Can I please get some help on how to accomplish this ? Thank you
Hi @Aisha M ,
Please create a behaviours, link it to the due date field and use this script (update the custom field id) :
import groovy.transform.BaseScriptimport com.onresolve.jira.groovy.user.FieldBehavioursimport java.sql.Timestamp@BaseScript FieldBehaviours fieldBehavioursdef duedateField = getFieldById("duedate")def duedate = duedateField.getValue()def currentDate = new Timestamp(new Date().getTime())int textFieldId = 10002def textField = getFieldById("customfield_" + textFieldId)if (duedate != "" && currentDate > duedate){textField.setHidden(true)}else {textField.setHidden(false)}
Let me know if that helped.
@Antoine Berry Can I please have your thoughts on this
@Antoine Berry Thank you for the reply. How do we link Behavior to the custom fields , is there a specific way ?
Hi @Antoine Berry , I did the following thing,
I added the "Reason' custom field to the Edit & View screens of the Epic Issue Type
Then went over to the Behavior Add-on, but the configuration seemed confusing.
Anyway, I added the project & issue type details, and under the "add field" , selected the "Due Date" and added the script & saved.
Later, tried moving the Due Date to a later value, and nothing happened Like when I clicked to edit the Due Date, the "Create issue screen' popped open, but nothing prompted me to fill anything, I simply able to modify the field and update the issue with filling the "Reason" text field also.
@Antoine Berry Hello, are you doing okay ??
@Antoine Berry Hellooo ! Hope you are doing amazing ! I finally logged back into my older account, was just too lazy to reset the pwd . . :D Lol, cannot believe how much I had bothered you with my questions ! Thank you so much for always responding to them & helping me out . . I don't think I would have survived in my project without your help . . But, I still suck at coding though . .
Hello @Aisha M
I am doing fantastic, glad to hear from you ! It is always a pleasure to be able to help the community. No doubt that you have made great progress throughtout the journey anyway.
Have you moved to DataCenter ? Automation will help you without coding.
As a matter of fact, I actually need to answer questions so if you need any help do not hesitate to ping me !
It looks like you're new here. Sign in or register to get started.