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 ?
Hi @Lakshmi S
I have given a similar solution in this Community Post.
Give it a go and let me know if you are stuck anywhere.
Thank you and Kind regards,
Ram
Hi @Ram Kumar Aravindakshan _Adaptavist_ ,
The post (code) appears to be working as the date is displayed after the ticket is created. However, I would like it to display the changing value on the create screen to avoid confusing users. We use this "Need By Date" in many scenarios in the same project.
If you see the attached screenshot (using my above script), when I select "Production Issue - Wider Network Impact" from the "Ticket Category" field, the Priority and Escalation? field values change to Blocker and Yes.
In the same way, I want to display the "Need By Date" field on create, based on the following matrix. Is it possible to achieve that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.