Hello ,
I need to set custom field value to NULL when i edit other custom field using add-on behaviour ,
Hi Taher.
Your description of your issue is rather shallow, so I'm going to try my best with the little information that you provided.
If you have 2 fields, A, and B, and you want to reset A when B is changed. You need to set a behaviour on field B, and when it gets changed, you need to change the value of A to "empty" rather than null. Null could cause issues.
If A is a textField you could do this:
def A = customFieldManager.getCustomFieldObjectByName("A") issue.setCustomFieldValue(A, "")
I hope this helps.
Cheers
DYelamos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, that should work in the behaviours part of SR.
Oh wait, aren't you using SR at all?
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.
Can you send the whole of your script? I might be able to help you better with more information taher. I want to help you mate but you keep sending very little info, and that doesn't really help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are in behaviours you need to use something like this:
getFieldById(SPEP.id).setFormValue("")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
when component is changed i want to set the other custom field nulled
import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript import static com.atlassian.jira.issue.IssueFieldConstants.* @BaseScript FieldBehaviours fieldBehaviours def ff = getFieldById(COMPONENTS) def values = ff.getValue() def URL = getFieldById("customfield_15008") def URLD =getFieldById("customfield_15009") def Request =getFieldById("customfield_15011") def URLField = getFieldById("customfield_15012") def TOBE = getFieldById("customfield_15013") def source = getFieldById("customfield_15014") def dest = getFieldById("customfield_15015") def port = getFieldById("customfield_15016") def InApp = getFieldById("customfield_15021") def ReqR = getFieldById("customfield_15022") def specy = getFieldById("customfield_15023") def res = getFieldById("customfield_15024") def SON = getFieldById("customfield_15027") def SOT = getFieldById("customfield_15028") def SOL = getFieldById("customfield_15029") def SPEP = getFieldById("customfield_15030") def IPSE = getFieldById("customfield_15031") def SERV = getFieldById("customfield_15032") def RIGHTS = getFieldById("customfield_15033") /*---------------------------------------- Declation variable -----------------------------------*/ SPEP.setHidden(true) IPSE.setHidden(true) SERV.setHidden(true) RIGHTS.setHidden(true) SOL.setHidden(true) SOT.setHidden(true) SON.setHidden(true) res.setHidden(true) specy.setHidden(true) ReqR.setHidden(true) source.setHidden(true) InApp.setHidden(true) dest.setHidden(true) port.setHidden(true) URLD.setHidden(true) URL.setHidden(true) Request.setHidden(true) URLField.setHidden(true) TOBE.setHidden(true) /*---------------------------------------- hide all -----------------------------------*/ if(values.toString().contains("NEW URL")){ URL.setHidden(false) URLD.setHidden(false) }else if (values.toString().contains("Publishing URL / OPENING PORT")){ Request.setHidden(false) }else if (values.toString().contains("INTERNAL APPLICATION ACCESS")){ InApp.setHidden(false) }else if (values.toString().contains("NETWORK SHARED")){ res.setHidden(false) }else if (values.toString().contains("NEW SOFTWARE")){ SON.setHidden(false) SOL.setHidden(false) SOT.setHidden(false) }else if (values.toString().contains("PHYSICAL ACCESS")){ }else if (values.toString().contains("SERVER ACCESS")){ SPEP.setHidden(false) IPSE.setHidden(false) SERV.setHidden(false) RIGHTS.setHidden(false) }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well you would do it as I told you.
You get the id of the field you want to set to empty, in your case that's SPEP I believe and you do this:
SPEP.setFormValue("")
Tell me if this works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello daniel
thank you it work :D
but i need another thnik i juste need how to chek if component is changed on edit screen and based to this boolean value i will set the next status
can you help me
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.