Comments
-
I found some typos in the last script I suggested. Please try this again and report back with the content of the log for the execution that did not work. def customFieldNameHasValue = cfValues['customfieldname'] != null def priorityIsChanged = changeItems.any { it.get('field')=='priority'} def statusIsChanged=…
-
There should be two options when it comes to rendering wiki content n a scripted field 1) render the wiki to html in your velocity template 2) render the content to html in groovy I've dabbled with velocity rendering, but I was having issues after some upgrade and converted my own scripted field to use groovy-level…
-
Hi @Ian Balas Can you share a screenshot of your transition post function screen that shows where in the sequence this script is located? But let me go back to an earlier observation: You might need to think of a completely different round-robin algorithm. You can't use the last assignee to know who the next one will be.…
-
You could try: def customFieldNameHasValue = cfValues['customfieldname'] != null def priorityIsChanged = changeItems.any { it.get('field')=='priority'} def statusIsChanged= changeItems.any { it.get('field')=='status} def commentIsPresent = (event.comment) log.info "customFieldNameHasValue=$customFieldNameHasValue" log.info…
-
Which events did you configure your Scripted Listener to react to?
-
I find that it's helpful to break conditions down rather than sting them all together. Try something like this: import com.atlassian.jira.event.comment.CommentCreatedEvent import com.atlassian.jira.event.comment.CommentUpdatedEvent def customFieldNameHasValue = cfValues['customfieldname'] != null def priorityIsChanged =…
-
Yeah, you'd have to dig into the scriptrunner caching mechanism to figure out how to reload just a single class.
-
This particular snippet doesn't refresh the cache. In you have another script somewhere else that calls the class you just updated, it will still be the old version of the class unless you refresh the cache using the built-in script. The above simply loads the class from file with each execution without caching it. If you…
-
think you mean JQL (Jira query language) not JQuery (javascript module). I think your scriptrunner custom listener can take care of the JQL and Bulk update ... something along the lines of the following should get you close: import com.onresolve.jira.groovy.user.FieldBehaviours import com.atlassian.jira.util.ImportUtils…
-
For VersionReleaseEvent the event won't have an issue variable. So event.issue is not an option Which issue do you expect to be updated? Think in terms of the UI. If you release a version in the project release page, how would you select which issue to update?
-
Hi Aditya I hope you understand that I do not work for nor do I represent Atlassian or Adaptivist. I'm simply a user of their products and I choose to volunteer some of my time to help others in the community as they helped me when I was getting started. So, joining a team call is strongly out of the question. That being…
-
The error you shared from your log points to the last line of the script. This is not surprising, that line should be in the same scope where the body variable is defined. Move that line to line #17 and try again. Share the logs that this generates
-
It would help to know what you have so far. But the VersionManager has a method to release a version: So the snippet would be def versionManager = ComponentAccessor.versionManager def versionObject = versionManager.getVersion(project.id, versionname) versionObject = versionManager.releaseVersion(versionObject, true)
-
Try this code: import com.onresolve.jira.groovy.user.FieldBehaviours import com.onresolve.scriptrunner.db.DatabaseUtil import groovy.transform.BaseScript @BaseScript FieldBehaviours fieldBehaviours def environement = getFieldById('customfield_17800') def desc = getFieldById("description") def prodValue = """ h2. Please…
-
I don't think this is possible with any of the built-in features. I think some custom JQL function (such as can be developed with scriptrunner) or a customer scripted field that returns a count of objects in the custom field would be required. You would have the same response if you were asking for a JQL where more than…
-
Double-check your base url in system configuration, that's what it should return. You can also confirm using the groovy console with: com.atlassian.jira.component.ComponentAccessor.applicationProperties.getString('jira.baseurl')
-
I had not used/test the convert options in JSM. I found the same CSS issue when using the convert method without ajax options. It might be worth reporting that to adaptavist. But since it appears to work ok when using ajax options, I think this will be your best bet. Here is a sample scriptrunner rest API where you can…
-
If that works for you then it's perfect. Yes, "environment" is a "FormField" object. You can get the value selected by the user with evironment.value (this is shortcut for environment.getValue()). I see that you don't have the "actionName" check anymore. Be careful with that. If you later change the environment field, the…
-
What have you tried... what were the results? Did you try to output intermediate values to log to try to investigate this yourself?
-
Hi Roy Welcome to the community. A while back, I posted an article where I shared some methods to extract attributes from objects. Maybe some of it should be able to help you. I'm a little confused about where you are and what you are trying to do. Are you trying to assign the Aircraft object to an Issue after the user…
-
I don't have Xray so I can test and figure this out myself, but maybe I can give you some strategies for figuring it out yourself. The critical thing you need to find out is if behaviour is even able to detect changes to Xray custom fields and getting the data. So, create a behaviour configuration with the correct mapping…
-
Yes I think the "var data = ... " is in the correct format ... but you are posting a different payload where Priority and Description field id are capitalized. Try with "payload": JSON.stringIfy( data )
-
I don't know why you are attempting to use $response in the body... presumably that doesn't exist. Are you trying to pass the id of the curret issue? If so, it should look like this: body = [Request:[issueKey:issue.key, issueId: issue.id as String] What do you get when you output this? log.info new…
-
Yes, unless there is a built-in REST Api you can use, any change you want to do permanently has to be triggered somehow on the server and that's generally done with a custom rest api. In this case, maybe the built-in api will work for…
-
Ok, then change this line: if(actionName == 'Create Issue'){ to if(actionName == 'Create'){ Not sure why I assumed the actionName would be "Create Issue" ... even in my own code, I use "Create" when checking which actionName to execute some behaviour script against. But if you don't think you could have figured this out by…
-
Behaviour scripts can't run in the console. Methods like getFiedById(), getFieldByName(), getFieldChange(), getActionname() etc don't exist in the console. You can try to make some adjustments like this to get some clues are to what's not working: def issueTypeMap =[ Task: """\ h2. Please fill out the below form * Team…
-
What type of field is the "Vendor Type? Based on the error, it would appear that maybe it's a Multi Select or Checkbox. If so, the logic needs to be adjusted to account for that. import com.atlassian.jira.issue.customfields.option.LazyLoadedOption import com.atlassian.jira.component.ComponentAccessor def cfm =…
-
ah... then if vendor request type is a standard "single select" field, then we can simplify the script import com.atlassian.jira.issue.customfields.option.LazyLoadedOption import com.atlassian.jira.component.ComponentAccessor def cfm = ComponentAccessor.customFieldManager def om = ComponentAccessor.optionsManager //this…
-
Here is an example ... you'll probably want to grab the version id for the selected release. Then make an ajax call to some rest API that you'll have to create and possibly do something the API response: def panelOutput = $/ <script> function yourJsFunction(){ var versionId =…
-
If you've added a panel, presumably, you wrote some HTML code to display the button. Just write some javascript that responds to the button click event.