Comments
-
I'm not sure if what you are asking for is available directly. But here is an option that might work: ensure your listener is running as a different user when making the change. And in your script, if the current user is your listener actor, then skip the change. This way, it will only trigger once when changes are…
-
Hi Alok I reviewed your script and I think I understand what you are trying to do. But there are some mistakes/improvements: 1) The Sprint custom field can't return a date. It will return an array of Sprint objects. You'll have to extract the date from the last or current sprint. 2) There is a better way to deal with issue…
-
I'm not aware of any documentation other than the page I shared above. But based on that, the "issue" variable is only defined in the context of the search method you see in the '?' popup. So if you want to get a filtered subset of components, you can set the configuration script to: search = {String inputValue, Issue…
-
Did you re-index your site after changing the searcher? If you want to use the issue key searcher, your script field can probably only return an issue key. You might want to explore using the custom field template to control the rendering of your field to include the custom html.
-
With Groovy there are much better solutions for looping than standard for loops. Try this: import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript @BaseScript FieldBehaviours fieldBehaviours def selectFld = getFieldByName('Number of Fields') def numberOfFieldsToShow = 0 def…
-
This was my interpretation of your "if(!subBoolean ...) statement. Basically, if the current issue IS a subtask, we don't need to validate ITS subtasks, because it won't have any. So we "return" or exit the script immediately. You could change the comment to //no validation needed if the current issue is a subtask type
-
I don't think there is anything in the Insight reports that can show much about linked issues other than the "issue count" report But I think you can get some of what you want with pure JQL/Jira Dashbaord. For all issues linked to a specific object, use the iqlFunction in jql. e.g. InsightCustomField in iqlFunction("Name =…
-
GlobalActivityType.groovy is not a compiled script. You should be able to find that right from the script editor. There the issue arises when scripts are stored as "in-line script" in the various scriptrunner configuration. In those cases, the stack trace will include a randomly generated file name. In the example above…
-
First off... it's not clear if you are using a Simple Scripted Validator or a Custom Validator. Your script has components of both. The Simple Scripted Validator requires a true/false return value. The Customer Validator does not use the return value. Instead, the validation fails if an exception is raised (it will pass by…
-
You'll notice that like 5,6,7 are not necessarily complete. You need to make sure you map all your departments with the correct list of user names. In this case, I invented "jwillians" based on the full name you provided. You have to replace with the correct username. I modified the script to validate things and provide…
-
Ah of course, the cfValues quick access is not available in custom script configurations. You have to fetch the customfield object first then call issue.getCustomFieldValue Try this instead: import com.atlassian.jira.component.ComponentAccessor import com.opensymphony.workflow.InvalidInputException Map<String,…
-
You'll have to switch from a "Simple Script Validator" to "Custom Script Validator": And go into a bit more details import com.atlassian.jira.component.ComponentAccessor import com.opensymphony.workflow.InvalidInputException Map<String,List<String>> departmentApproverMap = [ Dept1 : ['bobSm', 'micmal', 'TestUser1'], Dept2…
-
Scratch all this, I need more caffein this morning. I read "multi-field" and assumed multi select. Let's try this again: def departmentApproverMap = [ Dept1 : ['bobSm', 'micmal', 'TestUser1'], Dept2 : ['jwillians', 'tessk'], //etc ] def approverName = cfValues['Internal Approver'].name def deptValue =…
-
Ah and if you will have multiple combinations to check try something like this: The question however is, which approvers are allowed when multiple departments are selected? If any approver from any of the depatments, you can try this: def departmentApproverMap = [ Dept1 : ['bobSm', 'micmal', 'TestUser1'], Dept2 :…
-
I think I missed that it was a multi-select. In which case the value is an array of options. To know the exact class returned, you need to manually output something to the log e.g. log.info "The value of 'Dept' is of type: ${cfValues[Dept].getClass()}" I think this should work def approverName = cfValues['Internal…
-
For single select fields, cfValues['Dept'] will give you an instance of an Option object. To caompare it to a it to a string, you have to look a the getValue method. Simliar thing for the userPicker. Those will be instanced of ApplicationUser. If you are not sure, you can output the getClass() to the log then lookup in the…
-
If you need to specifically query the value that's currently stored in the data base for the issue while in a behaviour, use the underlyingIssue like you would use the "issue" object present in many other scriptrunner areas. For due date, you can use the field directly def originalDueDate = underlyingIssue.duedate For…
-
Generally, in Groovy (maybe in Java too) if you need to supply an argument that is defined as "Class... objects" (they are called variable arguments) and your values are in a list or collection, you can expand your list with "as Class[]" For example def myFunction(String... args){ //so something with args } def…
-
I do a similar thing, but where it makes sense, I also store the template in an Insight object so that it's easy to update. A couple of things I might suggest 1) Add a try/catch block because if you have a ${variable} in your template that you don't supply in the binding, the script will just crash. You might want to have…
-
Put the script to set the default value in the Initializer. Then, add the script to display the error in the field's server-side script. But you need to check that 1 or the values are Notification3. Try something like this: def notifyFormField = getFieldById('') notifyFormField.clearError() def notfiyValues =…
-
Did you toggle the "read-only/editable" switch on the behaviour configuration? Can you share a screenshot of the behaviour screen?
-
The clue is in here: Possible solutions: removeActorsFromProjectRole(java.util.Collection, com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, java.lang.String, com.atlassian.jira.util.ErrorCollection) The uNameKey must be in a collection (of size 1). And a project object is expected rather…
-
There are some recent improvements to behaviours that I've not yet experimented with that might make this simpler. But in older versions, you have to use the option id with setFormValue on Select and Checkbox fields. And for checkbox and multiselect, you have to offer an array of optionId. Try this script: import…
-
In your groovy script, before you even write the first line of code, there will be 2 or 3 variables. log : an object of type org.apache.log4j.Logger to allow you to send messages to the insight_automation.log object : an object of type com.riadalabs.jira.plugins.insight.services.model.ObjectBean that is the subject of the…
-
In my many responses to this post, I've shown how a built-in script can be called from a post function. All the fields populated in the script correspond to fields in the built-in script form. It's up to you to figure out how to supply different values to these fields. If you are triggering from a post function, then you…
-
Set the (CopyProject.FIELD_COPY_DASH_AND_FILTERS): false to true
-
The clutter of re-designing the workflow to change the global transition into a series of transitions from each other status EXCEPT one is not worth it in the balance. A simple scripted condition does this job well in my opinion. issue.status.name != "Complete"
-
Maybe check that the source project has a valid project lead.
-
I'm not aware of nor have I attempted to search for such feature requests. So I don't know either way. I can imagine them implementing some limited amount of logging through the Audit Log that's available from the System configuration area. For all I know that's already in place in more recent versions of Jira (I'm still…
-
There is no audit trail or history for changes made to a schema or object type configuration including adding/removing attributes or adjusting attribute settings. Basically, you should have very few users with "Object Type Manager" or "Object Schema Manager" roles because their actions have to be trusted.