Comments
-
You can examine the data in your log and find out the best way forward with something like this: log.info cfValues['SAR BI Reporting'] log.info cfValues['SAR BI Reporting'].getClass() Depending on what the second line gives you, you could lookup that class in the API documentation and figure out how to campare the value.…
-
Look at https://confluence.atlassian.com/adminjiracloud/configuring-issue-level-security-776636711.html
-
When I use your standalone script in my scriptrunner script console I got "email 1". But then I changed def entity = " value 1" to def entity = "value 1" //removed the leading space The return value was email 1. Could that be the issue? Maybe this would be better: def complianceEmail = (entity.toLowerCase().trim() ==…
-
You can use JQL to find issues that are still open but were at some point in a sprint that is now closed. That generally means they were rolled over. When you manually remove a ticket from the active sprint, it doesn't keep that sprint in it's history. sprint in closedSprints() and sprint in openSprints() and resolution is…
-
I don't think there is a built-in limit on server (cloud does). You just might experience a performance hit or timeout if it takes way too long to get ALL the results if you have a lot. The startAt and maxResults seem to exist to be able let you chunk your data to prevent such risk. But I haven't been able to find out how…
-
What is the order of execution for all your post-functions? Are you using the built-in create-subtask post function? It would be helpful to understand how all your pieces come together to come up with some ideas. A bit of assumption here... but I would guess that if you have the issue key available during the post…
-
In my environment, they are in the AO_#####_STASH_SETTINGS under the key "confluence_macros".
-
I don't think it's possible to have a behavior script automatically open a new tab. While behaviors actions are run on the client side with javascript, you can't have custom javascript action outside of those available from the API Quick Reference. That said, I think your best bet might be to use the "setDescription" or…
-
You can just call an instance of the LogFileViewer class in your REST API after setting the authentication context to an admin that has permission to run such scripts. import com.atlassian.jira.component.ComponentAccessor import com.onresolve.scriptrunner.canned.common.admin.LogFileViewer def adminUser =…
-
There is only the jiraissue table. But since I'm connecting jiraissue to another instance of jiraissue, I used an alias for the second table so that I know that this is the one I will use for subtask-level information. For example, very simplified, without any linkage, here is selects from 2 tables (don't run this on a…
-
You can use separate JQL filters to return quarterly data: * resolution changed from empty during (startOfYear(), startOfYear(3M)) * resolution changed from empty during (startOfYear(3M), startOfYear(6M)) * resolution changed from empty during (startOfYear(6M), startOfYear(9M)) * resolution changed from empty during…
-
Not quite what you are looking for, but rather than changing the default, you could use some of the instructions here to manipulate the list available. Optionally, if you have the Scriptrunner add-on (and you are running on server) you can use a Behavior script to change the default value for just the context that matters…
-
With vanilla jira installation, what you are asking is not possible. Notifications are triggered by events. When an event is triggered on a sub-task, there is no event associated with the parent ticket. If the watchers of the parent ticket are not also watchers of the sub-task, you can't use the built-in notification…
-
Each jiraissue record in the DB has its own "timespent" value. This will not necessarily match the sum of all associated jiraworklog entries for a given issue. Linking between parent issue and subtask is done via the issuelink table where linktype = 10000 (or consult issuelinktype to make sure you get the correct id) If…
-
The Java API documentation for your version of Jira is your best friend. When you look up the issue object, you will see that issue.getPriority() will return a Priority object def priority = issue.getPriority() issue.subTaskObjects.each{subTask -> subTask.setPriority(priority) issueManager.updateIssue(currentUser, subTask,…
-
Uneducated guess here... I think your workflow post functions (if scripts are inline and not depended on a groovy file on the file system) will deploy as part of the project/workflow definition. But nothing else.
-
My understanding from your script is that you would need only 1 scripted field for something like "Total Hours". Maybe a second if you need to list all the issue keys. So new project RPT with only 3/4 fields on the screens * Client * OIG Strategic Goal * Total Hours * Issues Then you create your 16 issues: * RPT-1 Client…
-
I'm not sure if such a script would have been my first idea ... but if it works for you and you want to keep it, you could run it as a global service (see doco) and add a few lines of code to email the output instead of just outputting a string. You could use some simple html/table to make it more appealing in the email…
-
I think you just need to replace labelManager.setLabels(loggeduser.getDirectoryUser(),linkedissueId,labels.toSet(),false,false) with labelManager.setLabels(loggeduser,linkedissueId,labels.toSet(),false,false)
-
The "getFieldById" method from Behaviors returns a "formField" object. This is a scriptrunner/behavior class I think. Not a native class from Jira. And the value stored in the formField is probably just the sprint Id. So you'll need to get a customField object then lookup the value from the underlying issue. import…
-
I don't know of a way to do that. Plus different object may end up with the same id. You really need to understand the context first. One could create a script that takes an id, then iterate through all the common object types and try to obtain each object type from the given id and return all the type/class of all objects…
-
First, in want you most recently pasted, you are missing the code to actually get the value. This line: def s = customFieldManager.getCustomFieldObject(11037) Only returns the customfield object. You have to get the value separately from the issue def s_value = issue.getCustomFieldValue(s) Then, if you will build JQL…
-
If you want to try in the script console, you can get your issue object like this: def issue = ComponentAccessor.issueManager.getIssueObject("ABC-123")
-
Thanks for catching my typos. I corrected them. Glad I was able to help.
-
I just had a quick play with this scenario. This works in my environment: import com.atlassian.jira.component.ComponentAccessor def commentManager = ComponentAccessor.commentManager if(event.issue.isSubTask() && event.comment){ def parent = event.issue.parentObject def newCommnet = commentManager.create( parent,…
-
Static type checking errors are warning and do not necessarily mean that it won't run. I don't use cloud so I can't comment if this will work or not, but you should give it a try, One idea I'm getting from reading the documentation is to try issue.fields[10084]?.value == 'Value'
-
You'll need to go consult the Java API documentation for your version of JIRA. Also, you can try to output the list of available methods to the logs. For example log.debug "get comment methods: ${comment.metaClass.methods.name.sort().unique()} Also, don't worry too much about the errors reported in the scriptrunner code…
-
It might help to break some of those long lines down and output some messages to the log. For example, change: def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "SelectListA"} To def changeLog = event?.changeLog //with groovy, all get methods can be accessed with this sort of shortcut)…
-
Where is this code being used? DO you already have "issue" in the binding (like you would for workflow)? Let's assume you have a valid issue object. To get the values of custom fields, you must first obtain the custom field object, Then, you can get the value from the issue. def customFieldManager =…
-
replace " && " with two actual ampersands && The & encoding is an html encoding ... this was just a weird artifact of the post or some loss during migration from an older platform for community posts.