Comments
-
I haven't found a good resource for this. I generally decompile the jar and poke around. I think for default value, you can set the "value" attribute.
-
Of course ... Btw, if you haven't been looking there already ... you will want to start: https://docs.atlassian.com/software/jira/docs/api/7.13.2/com/atlassian/jira/component/ComponentAccessor.html And while I was there, I noticed that "getAllGroups" is deprecated and may not work in the future. The following will work:…
-
I think the necessary javascript resources that UserMessageUtil likely leverage are probably not available in the initial context after login. This Util class was intended to be called from workflows and issue related events. You could make a feature suggestion to adaptavist for them to expand the context where this…
-
It should be easy enough to do that with script fragment>install a web resource. What context did you try to install the script? Perhaps you didn't catch the ajaxComple event? Try this for your script: (function ($) { $(function () { $("#assign-to-me").hide(); }); $(document).ajaxComplete(function () {…
-
Test Management doesn't generate any events yet. So there is nothing to listen to. I had a discussion about that with them at Summit and I think it's on their roadmap. The best workaround I can think of is to create a service script that runs on a cron interval that will perform a sql select query to return the list of…
-
I was assuming you already had the HTTPBuilder imports... and I only used the code you posted. These are what I use: import groovyx.net.http.ContentType import groovyx.net.http.HTTPBuilder import groovyx.net.http.Method Then you request is done with http.request(Method.POST) {...}
-
If you want to store the header key in a variable, you must assign it to the headers object using the square bracket format. When you do headers.headerKey, you are trying to create a header with the literal key of "headerKey" So try: headers[headerKey] = mlogin (or is mlogin the literal value for the header? in this case,…
-
Something along these lines might work (untested) import com.atlassian.jira.component.ComponentAccessor import com.atlassian.crowd.embedded.core.util.StaticCrowdServiceFactory def crowdService = StaticCrowdServiceFactory.crowdService def groupManager = ComponentAccessor.groupManager groupManager.getAllGroups().findAll {…
-
Try something like this (2 variants proposed) No additional import required, it's all part of HTTPBuilder def http = new HTTPBuilder('https://api.cloudflare.com/client/v4/zones/$zone/purge_cache') def headerKey= "something" def headerValue = "somethingElse" http.request(POST) { headers."keyForYourHeader" = "value for your…
-
It's hard to know why it's not working without actually being there and trying. The way I would try to investigate the reason is to output several debug messages: import com.atlassian.jira.component.ComponentAccessor //make sure debuging missages are visible log.setLevel(org.apache.log4j.Level.DEBUG) log.info "Start of…
-
Remove the ) ... It's not needed. Probably just a typo on my part.
-
That's probably when the event generated doesn't include a changeLog. You can either try the null-safe operator def changeItems = event.changeLog?.getRelated("ChildChangeItem") Or wrap the whole thing in an if block if(event.changeLog){ def changeItems = event.changeLog.getRelated("ChildChangeItem") ... }
-
Here is how I would approach the entire problem * Create a custom event: Admin >System Events* Name it to something clear like "Dangerous Issue Security Used" * Pick one of the email template (there isn't much choice there) * Create a scriptrunner script listener: Fires an event when a condition is true * Projects: select…
-
Maybe that's too obvious to mention ... but I the target in your case should be /rest/scriptrunner/latest/custom/showDialog Also, I'm not sure if that part matters, but usually, I don't have parens for rest endpoints: showDialog { MultivaluedMap queryParams -> What happens when you go directly to your rest endpoint? From…
-
Depending on the field type for your customfield_11400, you may need to need to go one extra level (if it's a single select). def s1 = customFieldManager.getCustomFieldObject(11400) String s = issue.getCustomFieldValue(s1).value Then, rather than "s1"L , you should use the toLong() method Third, long lines of code are…
-
Here is how I would do this... import com.atlassian.jira.component.ComponentAccessor // some apis we'll use def customFieldManager = ComponentAccessor.customFieldManager def optionsManager = ComponentAccessor.optionsManager // first, define a variable to contain all your mapping, // this way you just need to update this in…
-
The "setCustomFielValue" method for a single user picker just updates the selected value. You could use a multi user picker to store previously assigned users. This field type stores an array of users as its value. But in both cases, the data source is always the full list of users that the current user has access to. I am…
-
DId you actually try to run it? Those static type checking errors are normal and expected with this. I generally ignore them. But if you really need to eliminate the static type checking errors you could try def userManager = ComponentAccessor.userManager ApplicationUser reporterUser =…
-
Maybe try def userManager = ComponentAccessor.userManager def reporterUser = userManager.getUserByName(ReporterField.value) if(groupManager.isUserInGroup(reporterUser , 'ReportersGroup'){ ... }
-
You would have to loop through all the dates in between your two dates and examine the day value assert New Date().getDay() == 0 //true Sunday assert New Date().getDay() == 6 //true on Sarturday
-
I don't have access to a cloud instance, but does scriptrunner with cloud support grapes? It looks like the javax.mail is available in a public maven library You can try this import javax.mail.* import javax.mail.internet.* @Grapes( @Grab(group='javax.mail', module='mail', version='1.4' ) It may not work the very first…
-
Assuming your rest endpoint returns the HTML for a dialog (<section role="dialog" ...etc), you just make the rest endpoint the target of the webItem in the "link" field. Like this:
-
I see a mistake I made on that line, it should not have parenthesis. Try && !linkedIssue.resolution.name in ["Declined", "Deprecated"] But generally, when I get into this sort of situation I do something like this import com.atlassian.jira.component.ComponentAccessor import com.apache.log4j.Level log.setLevel(Level.DEBUG)…
-
Scriptrunner behaviors don't currently fire when you use the menu "More>Link" from the issue. To enable behavior scripts and manipulate the list of link types, you would have to for the users to edit the issue either via the default edit screen or via a special workflow transition screen. Then, you could manipulate the…
-
xxx.setFormValue(null) is your problem. You are explicitly telling the behavior to clear our those fields.
-
Jira doesn't see to track the date of the links being added/removed other than within the changehistory. The changehistory is not exactly searchable via JQL. So the short/simple answer is no. What you'd need to do is somehow manually flag the issues that have had the linking communicated then compare that in the JQL to see…
-
If the target site doesn't have same-origin restrictions, you might be able to include it in an iframe inside a custom dialog.
-
If you still have access to the script console, you can remove all your REST configuration with the following script. PLEASE BE CAREFUL WITH THIS ===> if you have any other ScriptRunner Rest Configurations, they will all be lost. First export the configuration: import com.atlassian.jira.component.ComponentAccessor def…
-
If you want to bypass the jira email system altogether, you'll need to import some smtp or mail handler class. At this point, you're dealing with standalone groovy/java and you'll have better luck with generic forums rather than jira/atlassian specific ones. Quick google got this as first…
-
You might be able to achieve this with the issuesInEpics and epicsOf functions from scriptrunner. For example, the following filter returns all open issues in epics where at least one of the child issues in that epic is closed. project=JSP and status !=closed and issuefunction in issuesInEpics("project= jsp and…