Comments
-
Thanks, works like a charm.
-
What does your rest endpoint declaration line look like? Seems like you've cut that out of the code you shared.
-
Ah... I think I see my mistake. The "changeHistoryItem.newstring" is actually the displayName of the user. We need to get the changeHistoryItem.newvalue instead to get the username def validationOwner = ComponentAccessor.userManager.getUserByName(validationOwnerChange.newvalue)
-
That looks like it's might not be coming from the script, but from somewhere else in your configuration. Maybe the template. Maybe confi.validationOwner was set to null. So you may need to trap against that. I'm made some assumption in my recommendation. One of which is that the validation owner field is a user picker…
-
Looks like changeItem has a newstring attribute and not a newString attribute. Again... my apologies with the typos. It was correct on line 3 but incorrect on line 5 import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.MutableIssuedef validationOwnerChange = changeItems.find { it.field ==…
-
Looks like I made a typo ... make sure validationOwnerChange is spelled the same in all three places. But you may still get a static type checking error. Those don't always mean that the code won't run. It's just the editor's type checker can't confirm the type of a variable to see if it matches the type the method accepts.
-
Refer to this: https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_additional_configuration_in_emails In the condition and configuration box add the following to retrieve the validation owner and store it in the config variable. import com.atlassian.jira.component.ComponentAccessor def…
-
You can find some examples here https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_send_a_custom_email
-
By defining your projectList as String[] ... you are hamstringing yourself. Just get them as objects. Then you also need to get the object for the target new category. And finally ... this is groovy ... leverage it for simplicity Try this import com.atlassian.jira.component.ComponentAccessor def projectManager =…
-
Make sure your endpoint definition includes the queryParams in the call DEPLOY( httpMethod: "POST", groups: ["jira-administrators","jira-users"] ) {MultivaluedMap queryParams, String body -> def issueKey = queryParams.getFirst('key') def issue = issueManager.getIssueObject(issueKey) def customFieldManager =…
-
For that, you'll need some sort of event listener via scriptrunner. Listen for the "issue updated" event (or perhaps all issue event), then examine the changelog to see if the "Validation owner" has changed. Then decide what you want to do with that information. You could use the built-in "send a custom email" listener.…
-
Repeating as a separate answer ... in case you'd like to mark this as the correct answer: You'll need to pass the issue key in your web item link then parse that out in your rest api. In web item link, try /rest/scriptrunner/latest/custom/DEPLOY?key=$issue.key Then in your DEPLOY rest API def issueKey =…
-
You'll need to pass the issue key in your web item link then parse that out in your rest api. In web item link, try /rest/scriptrunner/latest/custom/DEPLOY?key=$issue.key Then in your DEPLOY rest API def issueKey = queryParams.getFirst('key') def issue = issueManager.getIssueObject(issueKey) Maybe add a bit of error…
-
See my comment on your discussion post: https://community.atlassian.com/t5/Jira-discussions/how-to-execute-a-URL-in-url-customfield-in-behavior-script-and/td-p/1157749#U1158992
-
If you add a server-side script to your URL field, you can execute the get and store the result in another form field like this: import groovyx.net.http.ContentType import groovyx.net.http.HTTPBuilder import groovyx.net.http.Method def url = getFieldById(getFieldChanged()).value def targetField = getFieldByName("Url fetch…
-
You could try something like this: if(cfValues['Global']?.value == 'Yes'){ return (cfValues['Users']) } else { return cfValues['Users'] || cfValues['User Types'] || cfValues['Dataset'] } Or you could use a custom validator instead and target the error message based on the condition (cfValues is not available, so you'll…
-
Jira has notoriously very little in terms of options for customizing the template of notifications. Scriptrunner won't really help you there unless you write your own scripts to take over the jira notification functionality (in which case you would have 100% control over the notification body). Some other add-ons (like…
-
We have over 500K issues and >500 projects. My export is 1.6G. I think you should try it. I think it's designed to work regardless of the size. Regarding the impact of changing the encoding, that might be best be answered in a DBA forum.
-
Then what you can do is have either a single or a few additional tabs and make sure there is at least one required field on that additional tab. So as you check each of the applicable checkboxes out of the 25, the list of fields on the additional tab(s) is adjusted. Then by having one or more required fields on those tabs,…
-
The compareAttachment method above already does file size comparison if(file1.length() != file2.length()){ log.debug("compareAttachments: file sizes different") return false; }
-
While scriptrunner script fragment would let you create web items that can display a dialog box (with the full source of the dialog having to be designed and fed using REST API), there is no good way to integrate that with a field change. You would have to write your own javascript to react to field change, and display the…
-
Inline scripts, from what I've seen, are encoded when stored in the database. My not a db expert, but I wonder if your conversion to UTF-8 didn't break some of that encoding? I would probably suggest you revert back to a pre-UTF-8 backup of the database (I sure hope you have that... and that you are still in a testing…
-
I don't think you are missing anything, you may just have something broken elsewhere. Here is a quick test I just did: I created a generic event (inactive because it's not associated with any notification scheme): And without doing anything else, it's visible in scriptrunner listeners: So I'd increase logging level on all…
-
Just a shot in the dark here... but I wonder if this is because the issue was created before you added those custom field. When you update the issue to change the epic link, the form also initialized the custom field with an empty array: changed from null to [] When you create a new ticket after those fields are fully…
-
Ha... sorry, I missed seeing the portal tag. I don't have any experience using behaviours with the SD portal.
-
Thanks, Nic! I wouldn't be able to try a password reset, because I wouldn't know which email address to specify. I may have, at some point or another used a +alias in gmail address for signing up. When I @mentioned those 2 unknown accounts, none of my known email accounts received a notification. And If they were tied to a…
-
Your script works for me. Where did you put this script? Are you seeing any errors in the jira logs? Did you make sure you have the correct mapping on the behaviour config?
-
Get your schemeManager via the ComponentAccessor def schemeManager = ComponentAccessor.notificationSchemeManager
-
I'm on 7.13.2 and have no problem using javascript in field descriptions. I see other posts about it being disabled... but I'm not sure why my environment still works. That being said... I don't typically use field descriptions for javascript injections. You could just create a Script Fragment via scriptrunner and deploy…
-
That's pretty far behind. I think your first troubleshooting step should be to get the latest version.