Comments
-
When I was very new to groovy and java ... I wrote this function. def compareAttachments(File file1, File file2) { if(file1.length() != file2.length()){ log.debug("compareAttachments: file sizes different") return false; } try { InputStream in1 =new BufferedInputStream(new FileInputStream(file1)); InputStream in2 =new…
-
That may be a good suggestion for a feature enhancement to behavior. But why couldn't this be achieved with javascript in the description? This works in a simple test (using announcement banner for applying globally) <script> AJS.$(document).ajaxComplete(function () {…
-
Which version of scriptrunner? I would try to delete the custom field to see if this restores your ability to view the script field page. * Go to Admin -> Issues -> Custom fields * Search for the script field you created * Make sure the type is "Scripted field" * Delete the custom field. Then go back to the scripted page.…
-
I haven't played with the new mail-handler yet ... but have you looked up how to generally set a select custom field using scriptrunner? There are loads of examples here on the community. My guess, after a quick read of the documentation, is that the messageHandlerContext.createIssue requires an issueObject created with…
-
I'd recommend you ask them directly from their JSD portal: https://productsupport.adaptavist.com/servicedesk/customer/portals From what I can tell, I think you are right that the public API is lacking a PUT option to just add test cases. But if you feel adventurous (and the fine adaptavist folks may not like what I'm about…
-
I don't have a way to verify, but I wonder if it might be a permission issue. In the console, you are obviously an admin. But in the post-function, you might expect a non-admin user to kick that off. I guess if you perform the workflow function instead of a non-admin user... does it work? Or does it not work regardless of…
-
Try (currentAssignee == null)
-
Not according to the supported platforms page: https://confluence.atlassian.com/crucible/supported-platforms-298977375.html
-
There are a few options. You can call the built-in script directly via rest from within your jira instance as if you were calling it remotely: https://scriptrunner.adaptavist.com/5.5.7/jira/builtin-scripts.html#_executing_built_in_scripts_remotely But you can also implement the canned script within your own scripts. Either…
-
Have a look here: https://community.atlassian.com/t5/Jira-questions/scriptrunner-clone-and-link-additional-action-to-clone-all/qaq-p/110551
-
Are you using the built-in jira clone functionality? That's the only place that I'm aware with a "Clone Links" checkbox. One option that may work for you is to create a workflow transition with a "Clones an issue, and links" scriptrunner post function. Then, follow the documentation for "Control of cloning links"
-
I haven't use this yet ... but found its entry on the marketplace ... and then followed the "Documentation" link that points to https://bitbucket.org/Adaptavist/jsd-canned-comments/src/master/ There you'll see (under the "Conditions" header) that you can "add additional variables available to the template"
-
Nevemind ... looks like you already considered that. I didn't read carefully. I'll re-read again more closely now.
-
My experience in the past was that changing the epic link field didin't fire any event whatsoever. I just tested and it appears to now, (7.13.2) it fires com.atlassian.jira.event.issue.link.IssueLinkCreatedEvent So if you just watch for the Issue Updated event, you won't find it. But watching for that event... and…
-
What field type is "Release Environment" field? Is that a checkbox too? Then your problem is with: def newOptions = options.findAll { it.toString() == releaseEnvironmentVal } I suspect it returned null because it.toString() would never match releaseEnvironmentVal (which is a list of options) Try this instead: def…
-
Assuming you want the workflow status of the epic (and not the internal epic status (new/in progress/done) ... you can do the following using a scriptrunner custom scripted field: Give your new field a name: Status Of Epic Set template = Custom Put the following in the template: #set ($componentAccessor =…
-
While I had no idea how to answer you... I was sure it had to be possible and was curious. So I found that one of the built-in script rmo the admin menu has a dynamic field. Then, I had a look at the getParameters method it uses (you can look into the .jar file for scriptrunner to get such examples). And it looks like…
-
I don't know if that will fix your issue, but you can try to index the immutable issue instead of the mutable one. If you think about it... the immutable issue represents what's in the DB while the mutable one may not have been saved yet. If you are making changes to your mutable issue, make sure you store those changes…
-
The problem with this approach is that the parent issue will not show that change in the change history. Also, you have no opportunity to decide whether to dispatch an event for that issue. Maybe the watchers want to know about the change. But really, I'm not sure that there is a best approach for changing a single custom…
-
parent.setCustomFieldValue(parentAppDeployedTo, [optionsToSet, parentAppDeployedToValue]) I think, what you mean to do with this line is to ADD the list of environments listed on the child to the list of Environments already on the parent. So instead, I'd advise the following def newOptions = options.findAll {…
-
Here is how I execute OS-level commands: def sout = new StringBuilder() def serr = new StringBuilder() def cmd = "some command linke" def proc = cmd.execute() proc.consumeProcessOutput(sout, serr) proc.waitForOrKill(60000) if(serr){ log.error("Error executing command: $cmd \n$serr") } else { log.info("Command [$cmd]…
-
Yeah, get the list of options from OptionsManger Something like this: import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.customFieldManager def optionsManager = ComponentAccessor.optionsManager def cf = customFieldManager.getCustomFieldObjectByName("you list field") def…
-
One warning I should add... The default jira behavior (when you don't use Scriptunner behavior to set form values) is to keep the text typed by the user when they change project /issue type. So with a script like what I suggested, you could end up wiping out user's entry if they decide they want to change issue type (e.g.…
-
The way to avoid this is to make your mapping global (all issue type and all projects). Then detect in your script what the project and issue types are. If you have a need to have different defaults for different project/issuetype, you will need to account for that in your script. For example: def mapping = [ PKEY1 : […
-
There are several actions you can take throughout scriptrunner that will not update the index automatically. When you use workflow post functions, since the workflow will typically have a "reindex issue" function by default, then your actions will be accounted for by the re-index task. If your script is after that re-index…
-
Aww shucks! Awesome to get the recognition. Even if the @mention points to an apparent alternate Atlassian account I didn't know I had (tied to my personal email address and not the one I've typically been contributing under). Congrats to all awardees!
-
I had a quick try with getting a new builder based on an existing dashbaord then updating it. I'm currently getting a validation error without explanation (and have no time to investigate), but that may get you in the correct direction. import com.atlassian.jira.component.ComponentAccessor import…
-
A more extensive example is availble here: https://scriptrunner.adaptavist.com/latest/jira/recipes/dashboard-gadgets.html
-
You might want to check out the PortalPage.Builder I just created this on the fly on scriptrunner console... and it works: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.bc.portal.PortalPageService import com.atlassian.jira.issue.search.SearchRequest import…
-
I don't use Service Desk. So I can't verify. But you should always consult the ScriptRunner documentation first: https://scriptrunner.adaptavist.com/latest/jira/recipes/misc/jira-service-desk.html#_creating_internal_comments You'll usually find what you need.