Comments
-
My mistake, I always forget that insight custom field expect an array. Change issue.setCustomFieldValue(customField, objectKeyToSet) to issue.setCustomFieldValue(customField, [objectKeyToSet])
-
Haven't actually tested, but this should do the trick import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.jql.parser.JqlQueryParser import com.atlassian.jira.issue.search.SearchProvider import com.atlassian.jira.web.bean.PagerFilter import com.atlassian.jira.issue.search.SearchQuery import…
-
There is no exit/failure path (that I'm aware of ) for any post-function script. That's what validators are for. The best you can do is consume the standard error output from the command execution and let the user know. Maybe you need to split your python script in 2, a validation script and an execution script. Executed…
-
You can use the IQLFacade to find the object def iqlFacade = ComponentAccessor.getOSGiComponentInstanceOfType(IQLFacade) def iqlResults = iqlFacade.findObject("objectType = Users and User = $issue.reporter.name" def objectKeyToSet if(iqlResults){ objectKeyToSet = iqlResults.first().objectKey }
-
I haven't tried that... but I think you could run a script that runs a JQL to return an issue where the RO Insight field is missing, then just use issue.setCustomFieldValue(objectKey) I suspect that's what insight does when it detects the issue updated, issue created, and possibly also the issue assigned events. If you've…
-
You can either manually add it to the uri.path or apply a the query as a simple map object using uir.query. Like this: uri.query = [showFiles:true]
-
Sorry, I misunderstood the question. I've seen this occasionally after upgrading scriptrunner. When I go to an older workflow, it doesn't realize that the configuration points to a file and it displays the script tab. Also, when you have a NOTE in yoru configuration, the PATH of the file is hidden. I wish it still…
-
Hi Sigursteinn The SCRIPT tab is used only when you want to keep your script in-line and store it in the workflow (it's embedded in the workflow and can be exported with the xml) The FILE tab is used to tell the workflow which file on your filesystem contains the script. The workflow definition only contains the file path.…
-
If you can't include the test plan at the time of the testrun creation, there is no public api to update the traceability between the test run and test plan. You might be able to do it with the internal/undocumented api. rest/tests/1.0/tracelink/bulk/create With a payload that looks like this: {"testPlanId: 123,…
-
I see nothing wrong with this code. What doesn't work? Are you seeing any errors in altassian-jira.log?
-
Just a guess here but does the customer's jira instance have proper outbound connectivity to the internet? There could be some networking issues preventing groovy from accessing the package repository
-
Yeah I wrote all that directly in the answer box... not in an actual environment, so it was all from memory. I assumed you might have had the ComponentAccessor import already for other aspects of your script. The double def was just me deciding to define it outside the if block mid-way through my response and not being…
-
Behavior initializer run before the fields are populated from the data associated with the issue (from the database). So to check if a field already has a value in the initializer, you want to look at the binding variable "underlyingIssue" and load those values from that issue object Something like def fieldName = 'Board…
-
Ah sorry my mistake... this should work (lowercase f in customfield) def customerAssigneeFormField = getFieldById('customfield_10402')
-
Looks like your custom field is a Multi User Picker. From the earlier discussion, I was assuming a single user picker and shows a corresponding example. For multi user picker, you must do it like this: def customerAssigneeFormField = getFieldById('customField_10402') customerAssigneeFormField.setFormValue([custAssignee])
-
What sort of errors are you getting specifically? I see I was a little sloppy in my previous response (missing closing bracket and wrong method name) This should work, provided that "Product" is the actual name of the component and that cvigil is an actual user name. Also, I've made the assumption that dthompson is the…
-
Yes, unique custom field for each project with identical label and identical options (in the case of select type fields). Since all reports and filters within Tm4J or when using JQL let you select filter values by the label, having different unique id in the db doesn't seem to hurt anything. It will only make any potential…
-
You say "listener" script, but I see "getFieldById" which is a behavior method. If you are truly intending to use a listener, then yeah, that script will never work. So I'll assume from here on out that this is a behaviour server-side script on the "component/s" field. The first issue with your script is that you are…
-
Right now, that's not possible. I made a feature suggestion about that about a year ago. I can't trace it anymore since their service desk moved from Adaptavist to SmartBear with the recent acquisition. Also, since this is posted under the Adaptavist community and that app no longer belongs to them, you may not get direct…
-
If you attempt to run a script listener on the LoginEvent or DashboardViewEvent, the built-in "event" object will not include an issue and the type of event raised will not be an IssueEvent So these two lines will not work: def issue = event.getIssue() as MutableIssue def event = event as IssueEvent I'm not clear how you…
-
Glad I was able to help. If you feel it was helpful, please accept the answer.
-
Yeah, that's a strange one. Where are you looking at the log? Just in the scriptrunner execution history or in the jira-home/log/atlassian-jira.log file directly? Sometimes, I've seen instances where scriptrunner loses track of threads for logging purposes. Here is a full screenshot of my working example in the console:
-
Frankly I'm more likely to use the issueManager approach. So I never really experimented with the issueService. A bit of research showed that this is the correct way to add multiple values to an issueInputParameter: params.addCustomFieldValue(cf.id, '10405', '10406') Where 10405 and 10406 are optionId for the options to…
-
I never use the CustomField.updateValue() method for that reason. That is a really low level api. It doesn't generate any event and doesn't show up in the issue's history and it doesn't update the index. The next level up API is IssueManager. It will generate the history, but won't update the index. You decide whether you…
-
Ah I see. Then I think what you should do is use an event listener to detect when multi select is changed On issue 1 and apply those same options to issue two. You can use behavior to block edits on issue 2.
-
My point is that it is NOT possible to limit the option from multi-select from Structure. The options I provided were to present implications given that there are no other choices. I you go with #1, structure will always show ALL options. If you go with #2, structure will offer the field as an editable free text No real…
-
You have 2 choices. 1) Use the existing Multi-Select field. Continue to maintain the overall list of values (options) in the Custom Field context admin screen. In which case, you won't use the Select List Conversion, but instead, we will use the "setFieldOption()" method to dynamically show/hide some of the options (the…
-
Hi David Unless there is some other custom field from the marketplace that supports dynamic lookup based on other issue attributes you can't achieve this with standard fields using Scriptrunner but not within the confines of what is supported by Behaviours. The solution that comes to mind involves the Select List…
-
I think you mean "Custom Fields". So some custom fields are not shown on some issues. I find the admin tool: "Where is my field" helpful in this case: It will tell you why the field is not displayed and how to fix it.
-
You are looking for setFieldOptions() method of scriptrunner behavior There are several articles showing how to do that in the community