Hi Team,
import groovy.transform.BaseScript
import com.onresolve.jira.groovy.user.FieldBehaviours
@BaseScript FieldBehaviours fieldBehaviours
def ticketField = getFieldByName("Ticket Category")
if (getFieldById(getFieldChanged()).getValue() == "Production Issue - Wider Network Impact")
{
getFieldById("priority").setFormValue("Blocker")
getFieldById("customfield_10500").setFormValue("Yes")
}
else if (getFieldById(getFieldChanged()).getValue() == "Production Issue - Limited Impact")
{
getFieldById("priority").setFormValue("Critical")
getFieldById("customfield_10500").setFormValue("Yes")
}
The options ---
---
----
-----
------
| Ticket Category | Priority | Escalation? | Need by Date |
|---|
| | | | |
|---|
| Production Issue - Wider Network Impact | Blocker | Yes | Current Date |
| Production Issue - Limited Impact | Critical | Yes | Current Date + 2 Days |
| Blocking Go-Live | Critical | No | Current Date + 2 Days |
| Accreditation Testing | Major | No | Current Date + 4 Days |
| Strategic Customer | Minor | No | Current Date + 7 Days |
I am working on automatically populating the 'Priority', 'Escalation', and 'Need by Date' fields based on the "Ticket Category" field (below is the matrix). I have successfully managed to see the field value changing on the create screen when I update the "Ticket Category", but I am unsure how to set the "Need By Date" field on the create screen. Could you please provide some guidance on this using Script runner behaviors ?