When I move from one status to another like "open" to "returned", I have a transition screen with assignee field. I want to make this assignee field null on a transition screen. I have five of such transitions where I am trying to empty the field>
I tried using a postfunction, which was late for the field to be cleared.
We have ScriptRunner and Power Scripts plugins.
HI @Arunajyothi Samala ,
You can also achieve the same by making use of live fields in power scripts.
In SIL manager you will have to create a main script.
In main.sil should have a script something similar to the below, and it should be added to the live field.
eg:
if(argv["screen"] == "edit" || argv["screen"] == "create") {
lfSet("assignee", "");
}
in place of edit, create kindly replace it with your transition screen id as shown in the eg here.
let me know if it helped or if you have any questions.
Yes, I tried in Sil. It is working as expected. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have any recommendations for learning Groovy/SIl script tutorial for beginners(Who have no idea on how to code)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
through SIL I could be able to clear the feild on the Transition screen. But this required is also required on the transition screen. I could able to make the transition screen without filling any value in it. after transiton , the UI has the previous value only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Arunajyothi Samala ,
You can try adding Unassigned as a value. This will restrict the transition without having any value.
eg:
if(argv["screen"] == "edit" || argv["screen"] == "create" || argv["screen"] == "trans_31") {
lfSet("assignee", "Unassigned");
}
you can find more details about the documentation here:
https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15481931/How+Live+Fields+work
https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480338/lfSet
It's always easy to refer to some examples and modify the code.
https://appfire.atlassian.net/wiki/spaces/PSJ/pages/107544577/Recipes+by+Script+Type
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Arunajyothi Samala , I have one question to clarify your issue. You have a value set in Assignee field before the transition screen is displayed and you want to "dynamically" change it to "Unassigned" when the screen is displayed? Is that correct? If so, then you can use Behaviours and the script
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import static com.atlassian.jira.issue.IssueFieldConstants.*
@BaseScript FieldBehaviours fieldBehaviours
def assigneeField = getFieldById(ASSIGNEE)
assigneeField.setFormValue("")
More about Bahaviours in Script runner is here: https://docs.adaptavist.com/sr4js/latest/features/behaviours
Just let me know, if you need anything else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the response. Yes, that is exactly what I want. I am new to ScriptRunner Behaviour, kindly suggest how to achieve the same for four such transtions with transition screens to make it null
But I have 4 such transitions with Transition screen to make the assignee field null. Like from Fixed>Ready to deploy transition screen.
Open>Returned etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Arunajyothi Samala , when you create Behaviours configuration you will
There are some useful examples in Adaptavist's documentation. You should definitely check it and play with it a little:
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.
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.