Hi,
I considered, that there are two different behaviors when creating a new Jira issue:
Normally that would make no difference but we use Behaviours from Aptavist SriptRunner to set description templates depending on the issue type. In the first case this works great, in second case the behaviour doesn't work - probably because in this case there is no field "issuetype" to watch for changes.
Is there a way to avoid the second "Create" behavior (so Jira must always use the dialog with project and issue type fields)? Or is it possible to initialize the description field in the second dialog depending on selected project and type?
Thanks in advance!
Frank
Hello @Frank Winkler
I ve worked around with this defect and find solution.
Place your script in Initialiser function and it will work.
Hi@Mark Markov!
I placed the script in Initialiser AND to field "Issue Type" and now it works in both dialogs.
Thx, best regards!
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mark Markov
Unfortunately I have to come back to this problem because I considered that using the Initialiser function works fine for the 2. "Create Issue" variant but not for the 1.
Our Description templates must be set only if field Desription is empty or contains exactly one of the given templates. If the user changes the Issue type field after he entered someting into the Description field or changed the displayed template than the Description must no be replaced by a template. For this reason I use
def desc = getFieldById('description')
def currDescr = desc.getValue()
to decide if the content of Description field may be replaced by one of the templates or not. Using this code in the Initialiser, currDescr is always NULL so the Description will always be replaced with one of the templates.
The main problem seems to be, that the Initialiser script runs not only when the Create Issue screen is opened - it runs, too, when the field Issue type is changed in the open Create Issue screen.
So, the solution could be to have a script that runs after field "Issue type" was changed and an Initialiser Script, but ensure that the Initialiser only changes the Description field when it runs in the second "Create Issue" variant.
So, my question: is there a way to detect in the Initialiser script in which of the two "Create Issue" variants it currently runs? Maybe this can done by detecting if "Issue type" is displayed as a DropDown menu or as read only value? Unfortunately com.onresolve.jira.groovy.user.FormField has no isEditable() method.
Thx!
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Frank Winkler were you able to solve this? We face the exact same problem. Would appreciate if you could share your fix.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Frank Winkler I was just struggling with a similar Problem where we wanted to set the project and issue type descriptions as field descriptions when creating an issue. This does not reliably work in the two step Create screen, so we now check for the contents of the priority field. Usually, this should always have a value, but in the first step of the create screen, it will be null. So we have something like this to just skip the remaining script, if we are in the first step:
if (getFieldById("priority").value == null) {
return
}
Hope this helps if you have not already solved it!
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.