Can anyone please help me with how to use Script Listeners for the below scenario,
Field 1) Epic Due Date
Field 2) Baseline Due Date (Date picker)
I want to make sure that Field 1 copies the value of Field 2 the FIRST time its filled while the issue is created. Later , even thought the Field 2 value might be changed, the field 1 must not change its value and must be non editable (only viewable).
Thank you !
Hi @Aisha M ,
I would advise to create a Script Listener on the Create Issue event in appropriate projects. Make sure that this event is triggered in the workflows.Use this script (update the ids) :
def customFieldManager = ComponentAccessor.getCustomFieldManager()
int date1id = 12500
int date2id = 12501
def date1 = customFieldManager.getCustomFieldObject(date1id)
def date2 = customFieldManager.getCustomFieldObject(date2id)
def date1Value = issue.getCustomFieldValue(date1)
def date2Value = issue.getCustomFieldValue(date2)
date1.updateValue(null, issue, new ModifiedValue(date1Value, date2Value), new DefaultIssueChangeHolder())
Make sure field 1 is only on the View Issue screen so users cannot edit it.
Hi @Aisha M , I do not see any reason why this should not work on Issue Updated event. This event triggers when you edit the issue. You might want to create custom events for your needs.
Also you should investigate the logs to check why it is failing.
@Antoine Berry Thank for the help :) But unfortunately for me, they have changed the requirement to a completely different one and it sounds much more complicated :(
Now its like the uneditable field must capture the dates on when the BASELINE DUE DATE was entered and later whenever it gets modified . Planning to post about it and get help from the members
@Antoine Berry Yes, I have :) If you are interested to have a look at the new question , please use the link below
Learn how to use two new reports for next-gen projects in Jira Cloud: Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events