Hello Atlassian Community,
First of all, best wishes for 2023 !
I'm contacting you as we are facing an issue on our Behaviours (ScriptRunner plugin), especially on Edit screen.
Here is our usecase :
We have 2 projects : Project A with Epic issuetype and Project B with Timesheet Log issuetype, with same fields on both.
For these 2 projects, 2 Behaviours created : one for Project A and one for Project B.
Depending on values chosen one some fields, other fields are displayed or not, with default value or not, mandatory or not (->a lot of IF conditions).
To avoid mistakes on Create screens some values are initialized to "None" or "null" by default on some fields.
It's OK for Create screen but not on Edit one : in this case, as we reset most of the values to "None" or "null", the Edit screen resets automatically the values, which we do not want.
So here is our question : is it possible to restrict Behaviours only to Create screen, to avoid it apply on the Edit one ?
Thank you for any help on that case :)
There is 2 way to do it.
You can select a Guide Workflow in the Rule Behaviour configuration then for each Fields you can add a condition to execute only when it's a certain action suche as Create.
You can also in you script add the following condition at the begining of your script.
if(getActionName() == "Create"){
<YOUR CODE HERE>
}
Regards
Hello @Florian Bonniec
Thanks a lot for your quick answer !
I have tested and it works well :)
Just for my information, to have it on Edit, is it ? :
if(getActionName() == "Update"){
<YOUR CODE HERE>
}
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
No actually it will be empty.
getActionName() refer to the workflow transition, Update is not related to the WF so it return null.
https://docs.adaptavist.com/sr4js/latest/features/behaviours/api-quick-reference
Regards
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.
For Edit screen the behaviours should be as below
if(getActionName() == null){
<YOUR CODE HERE>
}
Regards,
Deepali Kohli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use this script for field "due date", but it doesn't work for field "original estimate"?
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.