You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I created a behaviour with following server side script based on field Component/s and mapped it to my project/issue type and it works as expected.
import com.atlassian.jira.bc.project.component.ProjectComponent
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours behaviours
def desc = getFieldById("description")
def descValue = desc.getValue()
def templateDGDesignComponentDesc = "THIS IS TEMPATE"
def components = getFieldById(getFieldChanged()).getValue() as List<ProjectComponent>
if (getActionName() == "Create" || getActionName() == "Create Issue") {
if (! underlyingIssue?.description) {
if (descValue == "") {
if (components.any {it.name.contains("DG Design")}) {
desc.setFormValue(templateDGDesignComponentDesc)
}
}
}
}
However, when I try to create a new behaviour, which I plan to map to a different project, the minute I select field Component/s and click on Server Side Script, the above code appears, if I update the code and save, it overrides the code in my previous behaviour.
Can I not have two behaviours for two separate projects with separate server side code based on Component/s field?
Hi Susan,
May I know which Scriptrunner version you're currently using?
It seems like related to this bug: SRJIRA-4418 which had been fixed in Scriptrunner 6.5.0.
Thank you so much for your help. You were correct, I upgraded our version of Scriptrunner from 6.2.1-p5 to the latest version 6.21.0 and the issue is now resolved.
Appreciate your guidance.
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.