Hi Team ,
Need your help on script so I have custom fields called as "initiated by" drop down values are "issue Owner" and "JVm" and another custom field called as "closed date" and another field called as "review date" and another custom field called as "closure review date" so when user select issue Owner in "initiated by" field and user give "closed date" field is greater than "review date" then "closure review date" should be mandatory or else if "closed date" is less than "review date" then "closure review date" should be optional
I tried with some script but it's could not help, could you please help with this task
Hi Devi,
I was able to replicate your use case using ScriptRunner Behaviours. You may want to reference the script that I used here (https://bitbucket.org/Adaptavist/workspace/snippets/bqyz6R/scriptrunner-dc-behaviour-check-the-value).
Make sure you've also added each of the 4 fields in Behaviours.
Hope this helps! If you still can't get it to work - I would recommend you to open a Support Ticket with us for one of our Support Engineers to investigate and work with you.
I assume you are using ScriptRunner Behaviours for that?
Could you provide the script you have so far?
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where did you place this code? You aren't using ScriptRunner Behaviours aren't you?
Also: anything in the logs? You also could try to add some debug logging in your if-statements to check if conditions are true or not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I have placed in script runner behaviour and I added debug log also so after the execution, it shows "no logs found in this execution".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another guess, do you use custom field translation? We ran into this and _thought_ that the custom field name will be the same for Behaviours. But in fact it is the translation based on the configured language of a user 😅
This is our solution so far:
switch (usersLocale) {
case "de_DE":
fieldName = "Beschreibung"
break
case "it_IT":
fieldName = "Descrizione"
break
default:
fieldName = "Description"
}
def field = getFieldByName(fieldName)
While "usersLocale" comes from com.atlassian.jira.user.UserLocaleStore
Also I'm not sure about the "@BaseScript" decorator you are using. I can't find this in the documentation, also we aren't using it as well.
But in general your script _should_ work
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.