I cannot get the following Initialiser Function code to work.
log.error "START INITIALISE" if (getActionName() == "Create Issue") { FormField desc = getFieldById("description") desc.setFormValue("Major") } log.error "END INITIALISE"
However if I move this code to the usual field mapping server side scripts pane it works just fine. The trouble is i want this code to only fire once on initial presentation of the "Create Issue" screen, so i need to be in the Initialiser section.
Any ideas why the Initialiser Function of the Behaviours plugin is not working for me?
In debug mode I am not even getting the error log messages so the entire Initialiser Function seems to be ignored.
JIRA 6.3.7
Scriptrunner 3.0.10
is there any update on this problem? I'm also having same issue.
Regards,
Murat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think this bug can be related to this one:
https://jamieechlin.atlassian.net/browse/GRV-724
I am going to investigate further, I'll update that ticket when finished.
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.
You may try to create a new test behavior with: Mapping: * Issue types: Any issue type * Projects: your project initialiser function: log.error "START INITIALISE" This is the most basic/clean case we may use to start to investigate. Can you see that message on the log when you create an issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have been experiencing similar issues as raised. Not able to get the initialiser to function or debug lines logging. Using JIRA 6.4.3, ScriptRunner 3.0.16. My initialiaser script is a simple intialise a user picker custom field as the "current user": import com.onresolve.jira.groovy.user.FormField import com.onresolve.jira.groovy.user.FieldBehaviours import com.atlassian.jira.ComponentManager log.debug("--------------------This is to test Behaviours Logging----------------") def rejectedWithdrawnByField = getFieldByName("Rejected / Withdrawn By") def currentUserName = ComponentManager.getInstance().getJiraAuthenticationContext().getUser().getName() rejectedWithdrawnByField.setFormValue(currentUserName) log.debug("Rejected Withdrawn By: " + rejectedWithdrawnByField.getValue())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
I am actually trying to do this for the Priority field. I need to remove from view for 1 project the MoSCoW priority values we also have. Here is my Behaviours config -
behaviours.PNG
I can remove the priority options I don't need but i can't get the Initialiser to run to set the default to "Major" rather than the invalid "MUST" which is the system default.
On initial form load I get what is in the image below. "MUST" will disappear from the options once i then choose something.
I have since tried to get the Initialiser Function to work on other custom fields but nothing happens, so I dont believe this is specific to me trying to manipulate the system Priority field.
priorities.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Should work... looks OK... can you paste a screenshot of the behaviour config? The page that shows the connection between fields and server side scripts. Have you mapped the behaviour to a project(s) / issuetype(s) combination?
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.