Hi,
I have a customfield "Kontrollrom" and I would like the input from this field to be copied to the Summary field, upon issue creation.
The cf is a insight object field, (name of the object is shown).
I have this script that I use in the Behaviour, but it only gives me the KEY for the object, not the NAME-attribute.
Any pointers on how to extract the name-attribute?
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 system = getFieldByName("System").value
def CR = getFieldByName("Kontrollrom").value
def summary = getFieldById("summary")
summary.setFormValue("""Audit: """ + "${CR}")
Here is a link to Riada's documentation regarding calling thier JAVA API to get object bean, hence, values.
https://documentation.riada.io/display/ICV53/Load+Object+by+Key
You might want to do that in script post function on create transition, because it may slowdown the UI in a behavior.
Cheers
Hi,
Thanks.
Yes, i've been trough this, but can't seem to get it to do what I want:)
Anyway.
Solved it by Autofilling Summary with the text i wanted ("Audit: "), using
def sum = getFieldById("summary")
def defaultValue = """Audit: """.replaceAll(/ /, '')
if (!underlyingIssue?.summary) {
sum.setFormValue(defaultValue)
}
Then I used Copy Value From Other Field (JSU) -
on the create transition post function.
Works like a charm, but probably not optimal:)
Br,
Anders
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.