Comments
-
If you leave it second to last, you will need a script more like what you had before and throw some debug messages to figure out why it wasn't working. But if you try my version, you will need to move the function up. And you can just add a toString() on that last line since the addCustomFieldvalue expects a string value…
-
You can use FieldConfigSchemeManager and getConfigSchemeForField to get all the contexts Then OptionsManager and getOptions to get the options in each of the Configs. For example, in groovy: def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName('Severity')…
-
Which position in the list of postfunctions on your transition is this script placed? My guess is that you have it set before the "Update change history for an issue and store the issue in the database". What I suspect is happening is that your script updates the issues in the background, but then the postfunction stores…
-
The way I've used this, label and html are functionally equivalent. html allows you to provide the label with some formatting (to highlight the matching text for example). After the selection is complete, the label is what you see in the field. Note that in other screens (view screen, issue navigator) the "value" is all…
-
Static Type checking errors are informational only. The code will still work. This is just because the code editor is unable to guess the data type of the rows variable.
-
While I agree from the other answer thread that ideally, mapping any select fields from the original issue context to the cloned issue context should be covered in the built-in postfunction "clones an issue and links". I think maybe something like this may work (not tested) import…
-
I don't have direct knowledge of this scenario, but you can try to examine requests in the chrome developer panel when creating your issue from the UI. You might get some clues as to how the payload is formatted for those multi-select database fields.
-
Have you explored the Select List Conversion feature? With this, you change your custom field to a free text field. But set the searcher/indexer to "Exact Text Searcher" so that it behaves like a select in JQL and gadgets etc. Then use the conversion method in behavior to change how the field is presented to the user. I…
-
Probably a matter of preference, but I like to keep the template simple and put the more complex stuff in the condition where you get better syntax checking.
-
Hi @Tom Lister Issues don't have an "url" attribute. If you think about it, it would not be a good idea to store that in the db because the baseUrl and the application context could change. So yeah, making a URL out of the baseURL and issue key is the only way to go as far as I know. def baseUrl =…
-
Add the following to the "Condition and Configuration" script block import com.atlassian.jira.component.ComponentAccessor as CA def issue = CA.issueManager.getIssueObject('JSP-1922') def cm = CA.commentManager def rm = CA.rendererManager config.renderedCommentsTable = """<table…
-
Presumably yes. I'm not sure if there are any types of field that would ever have a non-null representation of an empty value. It's possible that a free text field that was populated in the past, when cleared would return an emtpy string rather than a null. So we can instead use the following (also corrected an error I…
-
This should return true is any of the fields is null. Just adjust the fieldNames import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.customFieldManager def fieldNames = ['multiUserFiel1','multiUserField2'] fieldNames.any{fieldName-> def customField =…
-
Hi @Oleksii Okhmush You can get all your links using the RemoteIssueLinkManager import com.atlassian.jira.issue.link.RemoteIssueLinkManager import com.atlassian.jira.component.ComponentAccessor def rlm = ComponentAccessor.getComponentOfType(RemoteIssueLinkManager.class) def issue =…
-
I think you are missing the body containers. Try it like this: import groovy.xml.MarkupBuilder def writer = new StringWriter() def xml = new MarkupBuilder(writer) xml.'ac:structured-macro'('ac:name': "section") { 'ac:parameter'('ac:name': "border","true") 'ac:rich-text-body'{ xml.p("This is a Section")…
-
What have you tried that only returned the last comment? You should be able to use the commentManager and add all the comments to the body of your email. I would probably put them all in an Html table. Here is a quick snipet I created for the console import com.atlassian.jira.component.ComponentAccessor as CA def issue =…
-
Do you get any errors in the atlassian-jira.log file at the time of changing the assignee?
-
Are you getting this error when the script runs? Or just in the script editor? If just in the script editor, it likely can be ignored. This is just because the object returned by getFieldById('components').value is not known by the code editor and it can't figure out if "name" is a correct attribute.
-
Hi @Sid That should be fairly simple with scriptrunner behavior. Start with something like this as the server-side script for the assignee field (just change values in componentMap). import com.atlassian.jira.component.ComponentAccessor def pcm = ComponentAccessor.projectComponentManager def userUtil =…
-
You can also view the full log from scriptrunner built-in scripts. Or, after execution, refresh the listener page and click on the execution icon that failed. Log messages should be in there.
-
My guess would be that the Issue Security Level screen only looks at fields based on field key/class. Scripted fields have their own class. Whether the field is rendered as a user, group, text, number etc is only done at the HTML layer (template) and at the indexing layer (searcher). So the screen can't know that your…
-
Hi @Nathan Parmeter The solution that's coming to mind seems so simple that I wonder if I'm mis-understanding the question/problem. Isn't it just a matter of setting the value to null? formfield.setFormValue(null) BTW, a little trick I like to share... how do you like this version of your code? import…
-
I would use a scriptrunner escalation service for this and combine it with inactiveUsers() JQL function. Something like this: * JQL Query: project =JSP and assignee in inactiveUsers() and resolution is empty * As User: Pick a user * Leave the Action to None * Add a bit of script in Additional Issue Action. Because we're…
-
Hi @Maciej Olszewski If you have a Raw Xml module and you want to add a condition for it, you can follow these steps: * Create a dummy web-item fragment with your condition. * Then click the Preview button. This will show you the XML generate. * Grab the <condition> </condition> block and add it to your Raw xml module. But…
-
HI @Steven Mustari If your announcement banner javascript is interfering with Behaviors, I'd fix the interference before throwing the baby out with the bathwater. Maybe you had other too complex scripts that were interfering. In this article (linked from the issue linked by @Thomas Deiler), the css should be fairly limited…
-
Thanks @José Suanzes , that was an accidental omission in my post. I corrected it. However, for me, the key is "com.onresolve.jira.groovy.groovyrunner:rest-endpoints"
-
Have you looked at the documentation? https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_remote_issue_links Looks like issueFunction in linkedIssuesOfRemote("application name", "Confluence") will get you what you are asking for.
-
Sorry, I haven't used Portfolio yet. So I don't know if there is a native object model that can be used to find issues using that relationship. If it was just linked issue or issue/child issues like subtasks, then I would recommend using the issueLinkManager and the subTaskManager. But I don't know the Portfolio equivalent.
-
I've never had your specific scenario or tried what I'm about to suggest, but I think maybe you could do it this way: * Move most of your code in a rest endpoint. * Then your web panel would just include some simple javascript to call the rest api using ajax then load a placeholder div with the html returned from the rest…
-
You could try to increase logging level for the indexer. But from your explanation, it seems that your script giving the indexer data in a format that it doesn't know how to handle based on the searcher. Specifically when the issue is being created and the changeHistoryManager doesn't return any values. I'd recommend not…