PD Sheehan Expert

Comments

  • For fields to be conditionally required using behaviour, they can't be required in other configurations. Check the field configuration scheme and make sure the field is optional there. Note that this is one of the downsides of behaviour. It only works on screens and requires the underlying API to open. So if you do this,…
  • You can access the request type directly from the binding variable "context". writer.write("requestTypeId=$context.requestTypeId<br>") writer.write("requestTypeName=$context.requestType.name<br>") So you can dispense with the query altogether You can always examine what else might be available to you by outputting some…
  • That's normal. The insight groovy implementation is different and separate from the scriptrunner one. As far as I know, unless they are explicitly exported, plugin classes are only available within the plugin itself. Scriptrunner does some special things (all a bit esoteric to me) with script root etc to make your custom…
  • So, it looks like you are getting a formfield object: formFieldA, and then you don't use that anywhere. How did you think you were getting the selected values? You can add a line of code like this to give you some clues as to what happens when you select a version: formFieldA.setHelpText("$formFieldA.value…
  • You can try to output some information on your screen for debugging purposes: def MultiselectList = getFieldById(getFieldChanged()) // I tried this alternate statement as well -getFieldByName("Name") def MultiselectListValue =MultiselectList.value as List def hide = MultiselectListValue.contains("ABC")…
  • Have you put some thought into how you want the source multi-select to influence the target multiselect? What happens when multiple items are selected? Does the target multi-select simply offer a combination of choices mapped to each source option? If so, this should roughly work: def formFieldA = getFieldByName('fieldA')…
  • Here is an updated version of your PostFunction script: import com.onresolve.scriptrunner.canned.jira.admin.CopyProject import com.onresolve.scriptrunner.runner.ScriptRunnerImpl import com.onresolve.scriptrunner.runner.util.UserMessageUtil import com.atlassian.jira.component.ComponentAccessor import…
  • Try it like this: def MultiselectList = getFieldById(getFieldChanged()) // I tried this alternate statement as well -getFieldByName("Name") def MultiselectListValue =MultiselectList.value as List def hide = MultiselectListValue.contains("ABC") def fieldsToHide = ['Environment', 'Application'] fieldsToHide.each{fieldName->…
  • This line issueManager.updateIssue(assignee, issue, EventDispatchOption.ISSUE_UPDATED, true) Is attempting to save the source issue rather than the subTask Change it to issueManager.updateIssue(assignee, subtask, EventDispatchOption.ISSUE_UPDATED, true)
  • How about something like this: def fieldList = [ 'File Submitted Date', 'Requested Date of Transfer', 'Media to Client', 'Tran 119', 'Is a TLP required', 'Should TLP fees be billed to the client', 'Does the client need Tax amounts for these loans?', 'Change Contract Service_Type', 'Do you need TPS Recon?', 'Do you need a…
  • I am not familiar with the app that provides this project-level custom field.
  • The normal way to connect to Jira from Java is to create a plugin using the atlassian SDK. If you want to connect to a Jira instance from outside of Jira then REST API is the only way. There is a Java wrapper for the REST API, but I've never used it and I'm not a fan.
  • I can't see the full script, but the second error reads "the [adminUser] variable is undeclared" Are you sure you have the following line above the start of the screenshot? def adminUser = 'admin' //or other user name with permission to create projects The other errors can probably be safely ignored. Some errors are just…
  • There is no such thing as project status. But what you are describing can be achieved by changing the permission scheme associated with a project. PermissionSchemeManager is probably a good place to start
  • This is probably partially caused by new version of scriptrunner. Try the following: import com.onresolve.scriptrunner.canned.jira.admin.CopyProject import com.opensymphony.workflow.InvalidInputException import com.onresolve.scriptrunner.runner.ScriptRunnerImpl def sourceKey = '' def targetKey = '' def targetName = '' def…
  • I've never tried ... but looking through the javadocs, I found "ApplicationRoleAdminService" So playing around with it... I was able to get it to work with these few lines of code: import com.atlassian.jira.component.ComponentAccessor import com.onresolve.scriptrunner.runner.customisers.PluginModule import…
  • Hi Maahshid You can't use project permissions on a per-issue basis. If you adjust anything in project permissions based on the status of an issue, you're also changing the permissions on ALL other issues. I suggest you look into workflow properties instead.
  • For the record, I can't view the ticket you linked above. But if they validated your script that contains issueMutable.setResolutionDate(null) issueMutable.store() Without raising a warning similar to what's in the documentation, then that's good enough for me.
  • So, did you get confirmation from Adaptavist that using the issue.store() is what they're doing in their built-in script behind the scene?
  • If you want to stick with a strict behaviour/scriptrunner implementation, there is a slightly convoluted way to do it. Keep in mind that nothing I'm about to offer will prevent non-admins from finding and viewing the field value either using the rest API or issue navigator. And even when hiding a field on an edit screen…
  • I was going to say many of the same things you said @Nic Brough -Adaptavist- . But I have a question for you. Why would scripted field be less load on the system? The way I see it, scripted fields have to be run each time the ticket is viewed, edited, or indexed. Whereas listener script only runs on issue updated events…
  • I have only ever interacted with linux installations. But try E:\\atlassian\\Application Data\\JIRA\\scripts\\set-parentreferenceid.groovy
  • You can work within the markup builder to add a paragraph builder.p "Hi," builder.p "Below are this week's created, resolved, and unresolved issues" builder.table (style:"border-style:solid;border-width:thin") { thead { ... Or if you prefer to work with strings, extract the table from the string writer used in the…
  • This error: Cannot invoke method getRelevantConfig() on null object Indicate that the script failed to obtain a valid custom field objects. So it's not possible to get the configuaration for it. I took your script as is with def customA = customFieldManager.getCustomFieldObjectsByName("Custom A")[0] If your custom field…
  • Build the advanced search query according to your business needs and replace the appropriate JQL variable (resolvedJql or unresolvedJql). I would hope you understand JQL queries enough to achieve that if you have any jira experience. Perhaps something like this: def resolvedJql = "project = $project.key and created >…
  • Searching through the JavaDocs, I found: ProjectTemplateManager You can output the keys for your environment with import com.atlassian.jira.project.template.ProjectTemplateManager def ptm = ComponentAccessor.getComponent(ProjectTemplateManager) ptm.projectTemplates.collect{"$it.name = $it.key.key"}.join('<br>') But then,…
  • That's good, then what if we change it back to this? import com.atlassian.jira.bc.issue.search.SearchService import com.atlassian.jira.component.ComponentAccessor def user = ComponentAccessor.userManager.getUserByName('admin') def searchService = ComponentAccessor.getComponent(SearchService)…
  • I'm out of ideas for what to do next. What do you get when you run just this in the console? import com.atlassian.jira.bc.issue.search.SearchService import com.atlassian.jira.component.ComponentAccessor def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser def searchService =…
  • You can't completely change the permissions other than with the "Edit Issue Permissions" in the permission scheme. I understand that the permission scheme can't be configured to be conditional. It is all or nothing. The closest you can come to your requirement is with:…
  • For a Single Select field getCustomFieldValue() returns an instance of com.atlassian.jira.issue.customfields.option.Option So all you need to do is get the "value" property of that Option object. import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import…