Comments
-
Admins can define post-receive hooks that apply to all current and future repos: https://scriptrunner.adaptavist.com/latest/bitbucket/PostReceiveHooks.html Posting to an endpoint is simple enough, there is an example (in the event handling docn but should be similar)…
-
Fisheye and crucible have supported Hg for a while. In what sense do you mean support?
-
https://jamieechlin.atlassian.net/browse/GRV-815
-
Yes, have a look at com.atlassian.jira.project.version.VersionManager#createVersion, eg import com.atlassian.jira.component.ComponentAccessordef projectManager = ComponentAccessor.getProjectManager()def project = projectManager.getProjectObjByKey("ABC")def versionManager =…
-
Ideally you would upgrade to at least JIRA 6.2, and Script Runner 3, where this is easier. To old instructions are: It has to go on the class path, ie under WEB-INF/classes. Then provide the full qualified class name, eg com.acme.foo.Listener.
-
Yeah, but the line you've posted doesn't do much in itself. However generally you don't need to worry about indexing issues if you use IssueService: https://docs.atlassian.com/jira/latest/com/atlassian/jira/bc/issue/IssueService.html
-
It's probably null rather than an empty string. Why don't you try: ! cfValues['CF name'] || cfValues['CF name'] ==~ /\d{6}/ I removed the capture, don't see the need. Untested.
-
You should definitely mark Henning's answer as correct seeing as he's gone to the trouble of writing some code, and even testing it (!). This kind of thing is a non-trivial amount of effort.
-
that's not script runner, i removed the label and added the correct one.
-
I don't think there is a "Copy field value to parent" post function in script runner... maybe you are talking about some other plugin that has some similar ideas and concepts?
-
Looks fine. If it always returns false add the assert (just temporarily while previewing). You might have a trailing space or something or case issue or something.
-
Even though the question is over five years old yes it should still work. If not try adding an assertion in the previewer: https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_power_assertions What is your actual condition?
-
It's the same advice as above for stepping through groovy.
-
4gb is plenty. You don't need the source code to use those instructions, it's mainly to give people intellisense. You can attach the javadoc as well then you don't need to browse it on the web. Having the source code is helpful if you want to step in to the jira classes but it's not necessary for writing a plugin.…
-
Well - did you follow the instructions in the link above?
-
Hi, Yes it is correct (because getIssueType returns a GenericValue which implements Map, and you can get values by calling the key as a property in groovy), although it might be better to say: issue.issueTypeObject.name == "New Feature" > In general, where does one go to fine out the class name and class state (variables)…
-
You could use Henning's code, but just modify it to check if a comment with the same text already exists in the collection of comments for an issue.
-
That could mean componentIds is empty? If you don't get that there should be some other messages, maybe an error stack trace?
-
Not sure what you mean by "debug 2". Are you saying it doesn't print "2" from "log.error("2")" ?
-
The subcomponent values need to be available... all the plugin can do is remove them from the display. It can't create valid options. So make sure that when the behaviour is not applied, you see all the subcomponent options.
-
Add some logging to your script so you can see if it's being invoked. This is wrong: FormField formComponent = getFieldByName("components") The name is not components. Stick with: FormField formComponent = getFieldById(fieldChanged) If you want to change the example that's fine, but you need to add some logging to log the…
-
Thanks for the annotated screenshots. The plugin is installed and enabled, otherwise you wouldn't get to the first screen. The validatator should be on Components, not on Modules. That is, when a component is selected, you want something else to happen. The way you have it, when Modules change, something else will happen.
-
You don't have the plugin installed? Once installed make sure the behaviour is mapped to your project. Check the docs...
-
The example was for having a method in a file, if you're pasting it in then remove the "public void setSubComponentOptions ()" and closing }. Also add the imports: import org.ofbiz.core.entity.GenericValue import com.atlassian.core.ofbiz.util.OFBizPropertyUtils
-
Isn't that just this example: https://studio.plugins.atlassian.com/wiki/display/JBHV/Miscellaneous+Behaviours+Examples#MiscellaneousBehavioursExamples-Addorremoveoptionstosingleormultiselectfields ?
-
You need to put that behaviour not on the field that's being prepopulated, but on the field that it's getting it's value from. By default it fires everytime it's edited, which explains why it gets overwritten. If you want to only populate it if it's empty you have to handle that in code, eg: if (! targetField) { copy from…
-
If it works from admin console it should work from a post-function. Are all the parameters definitely the same?
-
You've jumbled up JQL and groovy there. But anyway, you can't really use a listener for that as they only fire when the issue changes, and you want to send mail when it hasn't changed for 30 days. This is what Escalation Services is for in Script Runner... you provide a JQL function, in your case it would be: status = 'In…
-
There is a function in the script runner plugin that can do this: issueFunction not in hasComments() or issueFunction in hasComments(-1) (ie, less than one comment).
-
It's not accessible to the public but good point! <searches for the Atlassian policy on same ;-) >