PD Sheehan Expert

Comments

  • Have you tried this: https://docs.adaptavist.com/sr4js/latest/features/listeners/built-in-listeners/execution-failure-notifier One of the code examples includes how to send an email.
  • You could have avoided this in the first place by limiting the use of in-line scripts. When you start creating your own classes, it's probably a good idea to start maintaining your code outside of jira. So if a post function or condition etc needs to access custom classes, you can create them as script files as well. Then,…
  • You can use a custom script postfunction in scriptrunner to achieve this. But I'm not clear on your requirements. What does the following mean? If I am creating a sub task for a story it should copy the Story Fix versions to sub task , if creating for any other issue type it should copy the value from parent to subtask Did…
  • I generally like to examine the call from my developer panel. Specifically, when your Create Issue in Epic screen loads, you should see a call to /rest/scriptrunner/behaviours/latest/validatorsByPid.json. If you examine the outgoing payload, that will give you a clue as to what information your initialiser script will have…
  • I think I know where my mistake was, but let's add some logging so we can be sure. import com.atlassian.jira.component.ComponentAccessor def optionsByType = [ 'Bug' : ['Missing Hub Confirmation', 'Missing Parcel/DocId'], 'New Feature' : ['Missing Specifications/Sample Data', 'Missing Retailer Contact'], //easily add…
  • Try the following version which I mostly just cleaned up a bit. import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate import com.atlassian.jira.component.ComponentAccessor; import groovy.transform.BaseScript import groovy.xml.MarkupBuilder import com.atlassian.jira.config.util.JiraHome import…
  • That might seem simple... but try to just return something at the end of the job. Like return null Or return "$issueCount issues created" // What I think is happening is that the "projects.each" closure is the last return statement and the job framework is attempting to serialize that closure to a JSON string which causes…
  • For getting the issue type in behaviour, I think you'll be better served with the issueContext rather than the underlying issue. issueContext is always available, but underlyingIssue will not be available during the initial issue creation. Then, you can group your list of options before your actual logic so you don't have…
  • The issue might be on the Slack side of this. It may not be sending a payload with the post. From postman, set the body type to raw>JSON or Content-Type header to application/json. You should be able to read the body content that way. As for how to handle that body, I'd recommend parsing with new…
  • It might be helpful to consult this page: https://bitbucket.org/atlassian/platform-module-usage/wiki/aui.md And review the AUI dependency change associated with your jira upgrade, then review the AUI changelog. E.g. https://aui.atlassian.com/aui/latest/docs/upgrades/aui-9.html#9.2-to-9.3 Also, from your old and new…
  • Did you make sure the fields name match with the correct case? it my original example I had impact with lowercase i.
  • Where did you implement that script? It should be in a Script Listener and associated with the "issue updated" and "Issue created" events. Copying that script as in (nearly) the "code to run" section of the scriptrunner script listener worked like a charm. THe only change I made to the script was adjust the field names and…
  • Can should share some extra details on your listener configuration? * What event is is listening to? * And is this all of your code? Where is the part that actually sets the priority field? I have a similar situation and it can be greatly simplified with the use of groovy map/data structure. I'm not super well versed in…
  • No, there are no JQL that can do this out of the box (including with scriptrunner). If somehow there was an actual link between the delivery ticket and the fix tickets, then you could use that. The JQL you are looking for would require a custom JQL function. Here is a custom JQL function script that you can start with.…
  • In your Web Item fragment, you can include the issue key in the "link" field". It should look something like this link: /rest/scriptrunner/latest/custom/yourEndPoint?issueKey=${issue.key} Then, in your rest endpoint, simply extract the issue Key from the queryParams yourEndPoint (httpMethod: 'POST', groups: []) {…
  • Here is some sample code for setting an issue property value using the IssuePropertyService. Note that issue properties can only be strings. import com.atlassian.jira.bc.issue.properties.IssuePropertyService import com.atlassian.jira.component.ComponentAccessor import…
  • @Elvar Böðvarsson I can't reply on the other thread, but DC and Server are the same product from a code perspective. It's all about the license. There are no separate releases for DC and for Server. So what happens after 2024-02-15? * Will Atlassian release security updates for Confluence Server 8.5 until the EOL date? *…
  • Did you copy the full script in the last reply? I had fixed an issue with a missing double-quote. Maybe you can include a screenshot that shows the full script and any errors. Here is an expanded example that I was able to test in my environment (except I left out the setCustomValuePart): import…
  • Try with the log like this: import com.atlassian.jira.event.type.EventDispatchOption def jql = 'issuekey=DT-13173' Issues.search(jql).each{issue-> issue.update{ setSendEmail(false) //adjust as needed setEventDispatchOption(EventDispatchOption.DO_NOT_DISPATCH) //adjust as needed def multiFieldOptionList =…
  • Maybe share your full script... all I supplied were example syntax. You have to adjust for your use case and field names and field types etc.
  • Can you add and report back the output of log.info "multiFieldOptionList result is $multiFieldOptionList (${multiFieldOptionList.getClass()})
  • You can still use HAPI to apply your JQL then run normal issue update code inside the search even if issue.update{ } doesn't offer a way to update the issue type (for good reason as mentioned above). Issues.search(jql).each{ issue-> //do issue stuff here, and use issueManager.update }
  • I've gotten around this limitation once by simply disabling redirecting the Assign Button and Assign to Me links to always use the edit screen where all the behaviours will engage. I've done this with a Show Web Panel Fragment using Location = atl.jira.view.issue.right.context Condition= jiraHelper.project?.key == "XXX"…
  • I believe you are referring to the "Project Details" page that is accessible from the Project Settings (generally as the second choice below "Summary"). If so, I just checked, and that is not a page that registers a panel location that can be leveraged by scriptrunner (at least not in my environment). Basically, if you…
  • I see you are using issueManager instead of the new HAPI methods. Perhaps you don't have access to the recent version of Scriptrunner that includes HAPI. So if you need to use the native JQL searching capabilities, here is how you could write your script: import com.atlassian.jira.bc.issue.search.SearchService import…
  • Is this a one-time execution? Or are you looking to have this operation repeated at a high frequency? I'm asking because you mentioned "Scriptrunner Job" which are designed to execute a specific task based on a pre-set schedule. Either way, it doesn't much matter, the best option i, is to use the methods made available by…
  • My interpretation of all this is that while new LTS Security Patches will be released, you will not be able to install them if your license has expired. That is the case right now, if you let your maintenance expire in the past, you were still able to use the product, but you would be capped at the last version released…
  • Yes, you can use scriptrunner to move an object. But it's not a simple command. You have to re-map all the attributes (even if they are the same), then because moving is an asynchronous process, you might need to wait for it to finish. But you can't wait forever, so you need a timeout. Here is some sample generic code to…
  • Thanks @Reece Lander _ScriptRunner - The Adaptavist Group_ I tried looking for anything related to this in the documentation including the JavaDocs. Doesn't seem to be there yet. Can you help provide some clues as to where in the JavaDocs the various methods available in those update methods (listed as…
  • I wonder if by copying a workflow, the postfunction script unique ID is replicated in the new workflow. This could cause the logs from one workflow's execution to be displayed in both workflow. But I doubt the workflow actually executed twice. You could confirm this by adding some logging to the script to output which…