When a user creates or edits an issue, I'd like the summary value of that issue to be auto-populated as the user enters values for 3 fields on the create/edit forms.
The summary value should look like "Pod - Name - Role"
As you can see below, I've written 4 behaviors mapped to this project and issue type. I don't feel like this is an elegant solution at all and it doesn't work. I'm hoping someone far better at this than me can point me on the correct path.
My scriptrunner behavior summary code is:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import static com.atlassian.jira.issue.IssueFieldConstants.SUMMARY
@BaseScript FieldBehaviours fieldBehaviours
def summary = getFieldById("summary")
summary.setDescription("Will be set auotmatically when user selects Pod, enters a Name and chooses a Role")
My scriptrunner behavior pod code is:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import static com.atlassian.jira.issue.IssueFieldConstants.SUMMARY
@BaseScript FieldBehaviours fieldBehaviours
def pod = getFieldByName("Pod").value
def name = getFieldByName("Name").value
def role = getFieldByName("Role").value
def summary1 = getFieldById("summary")
//summary1.setDescription("Will be set auotmatically when user selects Pod, enters a Name and chooses a Role")
summary1.setFormValue("${pod.} + " - " + ${name} + " - " + ${role}")
My scriptrunner behavior name code is:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import static com.atlassian.jira.issue.IssueFieldConstants.SUMMARY
@BaseScript FieldBehaviours fieldBehaviours
def pod2 = getFieldByName("Pod").value
def name2 = getFieldByName("Name").value
def role2 = getFieldByName("Role").value
def summary2 = getFieldById("summary")
//summary2.setDescription("Will be set auotmatically when user selects Pod, enters a Name and chooses a Role")
summary2.setFormValue("${pod2} + " - " + ${name2} + " - " + ${role2}")
My scriptrunner behavior role code is:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import static com.atlassian.jira.issue.IssueFieldConstants.SUMMARY
@BaseScript FieldBehaviours fieldBehaviours
def pod3 = getFieldByName("Pod").value
def name3 = getFieldByName("Name").value
def role3 = getFieldByName("Role").value
def summary3 = getFieldById("summary")
//summary3.setDescription("Will be set auotmatically when user selects Pod, enters a Name and chooses a Role")
summary3.setFormValue("${pod3} + " - " + ${name3} + " - " + ${role3}")