Comments
-
Yes that is possible. You have to decide how/when to send this information. It could be triggered by a workflow transition/post function, based on a Scripted Listener or a Job that runs on a schedule. Then once you've decided that and have one or more issue object, you have to decide what attribute of the issue (and custom…
-
I know nothing of python or what seems to be a python jira client. But I know that when updating a radion button with a REST API, the JSON for the value of the option you want to select will look like either {"customfield_10543":{"value":"Yes"}} or {"customfield_10543":{"id":"10461"}} So I would try changing this:…
-
Not that I am aware of. I think in big part because of how this field behaves (dynamic rest call rather than pre-loaded options). The best you can do is validate the user input after the fact and set an error if the selected user does not match your rules.
-
This was just an example, ultimately, you should review the documentation for ScriptRunner and HTTPBuilder. But I see that I have a typo in my quickly put together example. I have dot where it should be a comma in the post method. import groovyx.net.http.HTTPBuilder import groovyx.net.http.RESTClient import…
-
I like to use HttpBuilder or its simplified RESTClient The simplest way to make a POST request is with the RESTClient import groovyx.net.http.HTTPBuilder import groovyx.net.http.RESTClient import groovyx.net.http.Method import groovyx.net.http.ContentType def url = "https://some.domaim/" def rest = new RESTClient(url) def…
-
The Response.ok() method will take a simple object and automatically attempt to convert it to a JSON string. When you simply pass results.results, it appears to be failing (silently) in that conversion. I use the collect method to convert the more complex object into a simpler ArrayList of string which I then manually…
-
When I tried your script, I found that you were missing an import for the SearchService... but also, I think this can be simplified with the @JiraAgileBean notation import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean import com.onresolve.scriptrunner.runner.customisers.WithPlugin…
-
You would need to query the database directly. You can use scriptrunner resources to access the DB and scriptrunner custom REST Endpoint to provide a way for non-admin to view this data. Something like this: import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate import…
-
I think you'll want to curate your response body a little more than just providing a collection object like "results.results". And depending on what you want to return, you may want to manually generate a JSON object. The default "toString()" method might be okay too. Also, I am not sure it's a good idea to have your jql…
-
There is nothing wrong with the script. Did you try to run it? Sometimes, the script editor will report static type checking errors because it's unable to confirm the script is okay or not. Because groovy doesn't require objects and variables to be strongly typed, these sorts of errors can sometimes appear. They are not…
-
With a custom listener in script runner, you can change the subtask fields based on a parent issue change like this: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.util.ImportUtils import com.atlassian.jira.event.type.EventDispatchOption import…
-
What you want is def teamField = cFManager.getCustomFieldObject(10906) or def teamField = cFManager.getCustomFieldObject('customField_10906') or def teamField = cFManager.getCustomFieldObjects(issue).find { it.name == "Team" && it.customFieldType.name.contains('Tempo')}
-
You didn't tag your post with scriptrunner or Adaptavist... is this something that's available to you? Without that or some other automation tool, I'm not aware of a native way to have a listener, So can you start by letting us know what apps you have available in your environment?
-
I think you can clean up that condition ... try this: jiraHelper.project?.key != "OP" || issue.issueType.name != "User Story" || issue.subTaskObjects.size() == 0
-
The condition block in the "hide system or plugin ui" does not specify when you want to hide the item. It specifies when you want to show it. So you want to return True most of the time and False, when you want the item to be hidden. Right now, you are returning True on a specific project when the issue has subtask. It…
-
Does the link work? I would think that "sprint=x" is the generic system field name like summary=x and there is no way to change it
-
You can try using the "Hide System or plugin UI Element" script fragment.
-
The issue is in your last 2 lines. selectedValue is specific to the parent issue, attempting to check this for a null value in the every{} block is not achieving what you think. Here is the complete logic that you are trying to accomplish if I understand correctly issue.subTaskObjects.every{subTaskIssue-> def UOTypeValue =…
-
@Dirk Ronsmans if that's the case, it wasn't really intentional. I think it's likely a result of the evolution of the functionality. Initially, reference attributes just returned the label. Not terribly useful. So I added a 3rd parameter: Boolean returnObject = false If you change the method declaration to set the default…
-
Try putting this in your javascript instead: AJS.$(document).ready(function () { AJS.$("#key1").on("click",function(e){ e.preventDefault(); alert('call me'); }); }); A few things going on, 1) makes sure to bing the event only after the page is done loading (to be sure the web item is available 2) In jira, the Jquery is…
-
Meanwhile ... I think I can point you in the right direction for your second question: Multi-Select custom fields want to get new values as an Array of all the options you want to have in the field. I also prefer the issue.setCustomFieldValue(cfObject, value) approach over the cfObject.updateValue() approach. So an example…
-
Hi @NewByatl I'm having a hard time decoding your English. No judgment, I'm sure you tried hard. What might be helpful is if you provide some screen examples of each of the values available for each field. Then provide an image of what the 4 fields look like BEFORE the listener executes, then a separate image of what the 4…
-
The issueLinkCreatedEvent won't have an issue object to act on. So the built-in Send Email script won't know which email to send email to. Your options are either, use the custom scripted listener to send the email: import com.atlassian.mail.server.SMTPMailServer import com.atlassian.mail.server.MailServerManager import…
-
I suspect the \ in your string are as much a problem as the carriage returns Try this { "objectTypeId": 678, "attributes": [ { "objectTypeAttributeId": 2759, "objectAttributeValues": [ { "value": "C:\\\\Program Files\\\\Microsoft\\\\Exchange Server\\\\V15\\\\Mailbox\\\\address C:\\\\Windows C:\\\\ E:\\\\…
-
Thanks! Sorry... I don't have any good references other than the obvious like: * https://groovy-lang.org/documentation.html * https://library.adaptavist.com/ * https://docs.adaptavist.com/sr4js/latest * https://docs.atlassian.com/software/jira/docs/api/8.13.6/index.html?index-all.html I have a curious mind and I like…
-
Try Category in iqlFunction('Name = "IT Hardware" OR Predecessor = "IT Hardware"') or Category in iqlFunction("Name = \"IT Hardware\" OR Predecessor = \"IT Hardware\"") From a quote/escaping point of view: * The outer quotes are interpreted by JQL. JQL accepts both single or double quotes for function parameters * The…
-
Looks like there was a typo in my snippet. The last line reads lastAssiginee and should be lastAssignee (it should match what's on line 13 and 17) Try to run that in the console again and see if you get the correct user. Then in your main code, I'm not sure it's wise to have my suggested snipped into the block that will…
-
You can't make the dates grey or block them in any way (plus dates can alse be entered by typing). But with a behaviour script, you can validate the date as soon as it's selected and raise an error if it's not valid. Something along these lines: import groovy.time.TimeCategory def field = getFieldById(getFieldChanged())…
-
Yes that should be possible., if you can create an IQL for the list of objects to assign to the RO field, you can assign those objects. I suspect you would be looking at something like this: Assumption 1: the Application objects are selected in an insight custom fields called "Applications" Assumption 2: Servers have…
-
My suspicion is that you can't update Devinity Dynamic Form fields like that. This is okay for most regular custom fields. With Dynamic form, what you actually want to use their own API: https://deviniti.com/support/addon/server/dynamic-forms/latest/bundled-fields-java-api/ I have no experience with that. I just found the…