Comments
-
You should let the RESTClient handle the body conversion. Just create a groovy map object and pass that as the body. import groovy.json.JsonOutput import groovyx.net.http.ContentType import groovyx.net.http.RESTClient final externalUrl = "https://api.openai.com/v1/completions/" def body = [ model: "text-davinci-003",…
-
The important lines to me are: Cannot execute null+[JSothoron(jsothoron), LTaylor1(ltaylor1) at Script3$_run_closure1.doCall(Script3.groovy:25) Script3.groovy:25 means that the error is on line 25. Which matches what we see in the error as "null+[JSothoron(jsothoron), LTaylor1(ltaylor1)" Because line 25 was: def…
-
I agree with you on the poor documentation. I was much better in the riada/mindville days. I was lucky to get started with Insights just before the acquisition and had access to a lot of the old documentation during my "formative days".
-
Yes, you can import data into a confluence attribute. But your CSV must include the page id. Then the mapping is direct to that page id.
-
Sorry, I no longer have that example. The environment where I created it was refreshed. By point to, I meant that the attribute configuration is set Type=Object and Type Value is the object type I said it points to. In this example, the "Additional Value" (link type) doesn't matter. But later, when you have several such…
-
That is because you placed the script in the wrong place. The "initializer" script runs once when you open the form or when you change the project or issue type (it has to re-initialize in case the new combination of project/issue type results in a different mapping/behaviour). While server-side scripts on the individual…
-
Hi Your script doesn't work because you are defining variables inside a code blog and attempting to use them outside of that blog. def valueOne and def valueTwo The following would work: def valueOne, valueTwo if(fieldA.value == 'Apple') { valueOne = 1 } if(fieldB.value == 'Onion') { valueTwo = 3 } def valueTotal =…
-
Here is a quick sample script (using system field 'created' instead for simplicity) that shows how I would achieve the calculation using TimeCagetory: import groovy.time.TimeCategory import com.atlassian.jira.component.ComponentAccessor def issue = ComponentAccessor.issueManager.getIssueObject('XXX-nnnn') def ts =…
-
I don't see a "User" Attribute there. This is what a User attribute looks like: You can't use the currentUser() function against a Default/Text attribute.
-
"Primary User" is that a "User" attribute? Or an "Object Reference" attribute? The "currentUser()" iql function returns a "jira user entity", so you can only compare that against a "Jira user" attribute.
-
I think you should submit this to productsupport.adaptavist.com. But I'm not surprised this would be the case since all listeners are stored in the application properties system under a single entry (json formatted): Select e.ID, e.ENTITY_NAME, e.ENTITY_ID, e.PROPERTY_KEY, t.propertyvalue From propertyentry e Inner Join…
-
If you are trying to do this in a custom field IQL configuration for use in an issue creation, try to use "currentReporter()" instead. Otherwise, here is an example of the search working for me:
-
I have a few questions before I can understand what you're trying to do: * This behaviour, is it targeted for an issue creation? I.e. during creation of the issue, user fills in the multiselect and based on the selected value(s), you want to adjust/set the value on the "Product Team(s)" field? * Or will this need to run at…
-
Glad you figured it out.
-
Add some logging to figure out why it's failing: import com.atlassian.jira.component.ComponentAccessor def versionManager = ComponentAccessor.getVersionManager() def project = issue.getProjectObject() def tVer = issue.getKey() // Issue key is in the fixversion description def allUnreleasedVersions =…
-
The import configuration will report an error even if everything is ok until the object type configuration below is complete. So click on "Hardware" below your import configuration to expand that group and try to set that up.
-
Nice! If you feel I've earned it, please remember to flag this thread as "accepted"
-
If your CSV contains the same key or some other uniquely identifiable attribute in your insight object type, then the import will be a breeze. Just link your CSV to your import configuration. Map all the attributes you want to update (or are used to map to existing object). Be sure to check the "identifier" box for the key…
-
Where are you executing this? Is it in a post function? What this script does is look up ALL the unreleased versions in the project and adds them to the FixVersion field. Probably the original post where you found it, they were managing the releases such that they only ever had 1 available to select and populate. You must…
-
Sorry, I missed the notification. I investigated this a bit and it turns out that the "originalIssue" object provided in the Send Email condition doesn't work as you'd expect in this context. That only works in workflow postfunctions I believe. For listeners, you have to get the details of the old values from the…
-
That's a decent idea. You can look at this other response of mine for how you can access an internal url from groovy. Here is a snippet for sending emails. You'll have to find out how to attach the file you access from above: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.mail.Email import…
-
With the "EpicOf" jql function provided by scriptrunner, you can do the following: project in (AAA, BBB, CCC) AND (type in (Story, Task, Bug) OR issuefunction in epicsOf("project in (AAA, BBB, CCC) and type in (Story, Task, Bug)")) It's best practice to include a project filter in the sub-query to limit performance impact.
-
Why do you need CSV specifically? You could use the vanilla filter subscription functionality. Just make sure you create column specifications for your filter then create a group subscription with a recurring schedule. Jira will send an email to those recipients with a nice table view of all the matching issues. If you're…
-
Yes, the ScriptRunner Groovy Cache can be interrogated to help diagnose compile performance issues. It provides a number of metrics (the number of scripts, how many times they have been hit, and the total number of compilations) that can be accessed through the plugin console. By monitoring these metrics, you can gain…
-
Similar to what's described here: https://confluence.atlassian.com/jirakb/add-more-workflow-transition-buttons-to-jira-issue-page-1064082957.html You can also adjust the size of the main operations section in the opsbar by setting the configuration parameter 'ops.bar.group.size.opsbar-operations' to something other than 1…
-
I think you should report this as a bug on https://productsupport.adaptavist.com/servicedesk
-
Add some logs and review the details after the execution: log.info "Original Priority=$originalIssue.priority.name" if(originalIssue.priority.name != 'Medium (P3)') { log.info "Condition is false because original priority was not 'Medium (P3)'" return false } log.info "Current priority=$issue.priority.name"…
-
Here is a sample script (untested) that would work in scriptrunner behaviour to apply a default value to 1 insight field based on selection on another. You apply this script to the system field so that it runs each time that field is updated. import com.onresolve.jira.groovy.user.FieldBehaviours import…
-
You could try it like this: if(originalIssue.priority.name != 'Medium (P3)') return false if(issue.priority?.name != 'High (P2)') return false true By default if the current priority is different than the original priority, that means the priority was changed in the event. So there is no need to also look in the…
-
You haven't specified the names of your custom fields. So I'll use just "Level3", "Level2" and "Level1" to contrast from the attribute names of RSCM-Level n. I know the obvious direction is to use an IQL like the following (or some variation): objectType="RSCM-Level2" and Key = ${Level3}."RSCM-Level 2".Key But I found that…