Hi,
I am looking to update a custom Date & Time Field based on if a user clicks the "Yes" option in a Checkbox field.
I tried Project Automation but we have the free version and not all features are available.
I thought the alternative may be a scripted custom Date & Time Field that updates when the choice is made?
I have used this code previously when an issue is created but unsure how to modify the code for a checkbox field?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def issue = event.issue
// the name of the custom field to update
final customFieldName = 'Created Date & Time'
// the new value of the field
final newValue = issue.created
def customFieldManager = ComponentAccessor.customFieldManager
def customField = customFieldManager.getCustomFieldObjects(issue).findByName(customFieldName)
assert customField : "Could not find custom field with name $customFieldName"
customField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(customField), newValue), new DefaultIssueChangeHolder())
Any help is appreciated
Thanks.