Hi,
I am still very new to Jira and right now I am playing with the Scriptrunner, I tried to script behaviours in Jira Script Runner and something very wrong is going on here.
1st try:
Refreshed the same page:
Refreshed it again and now I see different field!
here is the Behavious Script:
Initialiser:
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
def owner = getFieldById ("customfield_12116")
def itsysteme = getFieldById("customfield_12110")
def itsysmenu = getFieldById("customfield_12111")
def app = getFieldById("customfield_12112")
itsysmenu.setHidden(true)
app.setHidden(true)
owner.setHidden(true)
IT-Systeme:
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
def owner = getFieldById ("customfield_12116")
def itsysteme = getFieldById("customfield_12110")
def itsysmenu = getFieldById("customfield_12111")
def app = getFieldById("customfield_12112")
if (itsysteme.getValue() == "None"){
itsysmenu.setHidden(true)
itsysmenu.setRequired(false)
app.setHidden(true)
app.setRequired(false)
owner.setHidden(true)
owner.setRequired(false)
}
else if (itsysteme.getValue() == "Navision"){
itsysmenu.setHidden(false)
itsysmenu.setRequired(true)
app.setHidden(true)
app.setRequired(true)
owner.setHidden(true)
owner.setRequired(false)
} else {
itsysmenu.setHidden(true)
itsysmenu.setRequired(false)
app.setHidden(true)
app.setRequired(false)
}
Menu:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
def owner = getFieldById ("customfield_12116")
def itsysteme = getFieldById("customfield_12110")
def itsysmenu = getFieldById("customfield_12111")
def app = getFieldById("customfield_12112")
if (itsysmenu.getValue() == "sys1" || "sys2" || "sys3" || "sys4"){
app.setHidden(false)
app.setRequired(true)
owner.setHidden(true)
owner.setRequired(false)
} else {
app.setHidden(true)
app.setRequired(false)
owner.setHidden(true)
owner.setRequired(false)
}
Application:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
def itsysteme = getFieldById("customfield_12110")
def itsysmenu = getFieldById("customfield_12111")
def app = getFieldById("customfield_12112")
def owner = getFieldById ("customfield_12116")
if (itsysmenu.getValue() == "sys1" || "sys2" || "sys3" || "sys4") && app.getValue() == "All Application") {
owner.setHidden(false)
owner.setRequired(true)
} else {
owner.setHidden(true)
owner.setRequired(false)
}
Its suppose to look like this.
Customer selects an Option from IT-Systeme
Menu Fields shows up (it was hidden before). Then Customer selects Menu (sys1,sys2 etc)
Application field shows up and after "all application option is selected" owner fields shows up and I am also not sure how to take owner from Owner field and fill the Approver (user picker field) with that information. What am I doing here wrong? remember I am very new, and testing jira right now.
Hi,
just found out that you might not speak German... Sorry about that.
If you're very new to Jira, why are you starting with the most complex stuff? You use ScriptRunner Behaviours. I would check for better, easier to implement, addons to achieve your aims. I'm pretty sure there's an addon Externsions for Service Desk which allow most of the stuff you're coding. Another option might be Connect Elements from the marketplace.
Best
JP
Hi,
Ich bin aus Deutschland und spreche auch Deutsch :D. Danke für die Rückmeldung :-).
I actually know alot about JIRA itself I am only new to Jira Service Desk and Scriptrunner. What we are trying to achieve is actually very complicated, I have already tried different addons and apps and unfortunately none of them worked. I saw how you can do quite alot with Scriptrunner and allow jira Service Desk to perfom very complicated task with that. I will check with Adaptivist as you said.
Thanks once again for the reply.
Regards
I.F
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
ich kann auch auf Deutsch antworten. Warum nicht erst einmal Jira ohne ScriptRunner Behaviours ausprobieren? Zu dieser sehr spezifischen Frage wirst Du wahrscheinlich wenig Feedback bekommen. Eventuell kann Adaptavist (Hersteller von ScriptRunner) weiterhelfen. Ich würde dort einen Support Call aufmachen.
Grüße
JP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.