Comments
-
Yeah, you'll want 2 quickfilters for that. Blocked issues: issueFunction in linkedIssuesOf("project = PHTP and status != Closed", "blocks") and status != Closed Blocking Issues: issueFunction in linkedIssuesOf("project = PHTP and status != Closed", "is blocked by") and status != Closed This assumes that an issue is no…
-
This inner query applies only to the linked issues. This says "give me all issues that are linked to open issues in the PHTP projects with the "blocks" link type. If you want to exclude non-closed issues in the final list, you need to add a "and status != closed" outside of the issue query. so perhaps: status !=closed and…
-
Sorry, bad cut and paste on my part. It should be def priorityField = getFileById(‘priority’) def priorityVal = priorityField.value I don’t recall what type of value you will get from this. It may just be the priority id. And then you may have to get the value from somewhere else. Or else find the I’d for your priority and…
-
For priority and other system fields, you'll want to use: getCustomFieldById('priority') Or, you can use the IssueFieldConstants class if you want to use autocomplete: import com.atlassian.jira.issue.IssueFieldConstants getCustomFieldById(IssueFieldConstants.PRIORITY)
-
All the scripted fields are still available via rest and java api. The only place you can't retrieve those fields is if you try to look directly in the database. So just retrieve the custom field like you would any other custom field:
-
You'll need to provide more details if you want help. Are you getting errors/stack traces? What date string is inputted in your date field? This was just an example of how to get the date in the user's format. Try it in the scriptrunner console. To apply to your code, you will need to do something like…
-
I was hoping to see what others would say about this. But I don't bother to store managers in different scripts. I try to only declare them if and where needed. Only if I create a function or a group of related functions that I'd like to use in multiple instances do I group them together into a separate class. Like I have…
-
Yeah, like this: issueFunction in linkedIssuesOf("projects = DE and resolution is empty", "blocks")
-
Groovy supports importing content dynamically using grapes So a quick search, I saw that p4java is available here https://mvnrepository.com/artifact/com.perforce/p4java/2019.1.1822775 So you can just call it like this in your script: @Grapes( @Grab(group='com.perforce', module='p4java', version='2019.1.1822775') ) import…
-
I didn't attempt to include all the code you might need. For example, you need to define and get the current user def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser Also, I'm assuming you already have issue define in the context binding (if you are doing this in a post function. If not, then you…
-
The "none" option in multi select field is not a real value, it is used to indicate that you want to clear that field. If you make the field required, users selecting none will be prompted that the input is invalid and they will have to make another selection. If you really need to hide the none value, you could use…
-
Glad I could help. Don't forget to make the question as answered to help others find this solution.
-
I believe you will have to use the LabelManager import com.atlassian.jira.issue.label.LabelManager def lm = ComponentAccessor.getComponent(LabelManager) def teams = ["YourAgileTeam"] lm.setLabels(currentUser,issue.id,agileTeamCf.id, teams.toSet(),false,false)
-
You can get the datepicker format of the current date based on the current user's language using the following: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.datetime.DateTimeFormatterFactory import com.atlassian.jira.datetime.DateTimeStyle def formatterFactory =…
-
The following will output the date picker date for the current date using the preference for the current user. import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.datetime.DateTimeFormatterFactory import com.atlassian.jira.datetime.DateTimeStyle def formatterFactory =…
-
Are you sure that your two ids are associated correctly to each other? I just installed a local version of Jira 8.2.2 and latest Scriptrunner. And I am able to set a cascading select using a very simple behavior. Here is my test. Cascade Field Options * parent 1 (10003)* child a (10005) * child b (10006) * parent 2…
-
You can call the built-in script from a post function custom script. But you should validate it first in a validator custom script in case any of the input fail. So something like this in validator: import com.onresolve.scriptrunner.canned.jira.admin.CopyProject import com.opensymphony.workflow.InvalidInputException def…
-
It's really not wise to have a literal default value of "None" for select fields. It becomes confusing with the system's apparent default of "None" which means "Null" in db parlance. If you can search in JQL with: "Field A" is empty then you do not have a literal default value of "none". In which case, your original code…
-
Maybe a SR version difference/bug. I’m on 5.5.3. 5.5.7 reports fixing an issue with online editing. I would try to update the open a support call with Adaptavist if you still have a different behavior.
-
Yes, exactly like that. Save your behavior configuration, then refresh your issue page and attempt to do inline edit of the priority field. Assuming this is in the same config with the same behaviour mapping as the initialiser.
-
Just add Priority to your behavior configuration (even if you don't apply any rules or script). When a field is listed in a behaviour configuration, editing that field inline becomes disabled. If you try, the edit screen will pop up.
-
Per the screenshot, it appears that you are using the post function built-in script "Fire an event when a condition is true". Please understand that an EVENT is only a message that something took place, you can't initiate an action like this. What may be more effective in your case is to run a simple scripted validator…
-
Ah perhaps... I don't have access to a Jira 8.x environment yet. If this works: ff.setFormValue(["20903", "22829"]) Then you can try this: ff.setFormValue(["$parentOption.optionId", "$childOption.optionId"])
-
The following works for me ... sets the cascading select field to the epic values when I change the epic link. import com.atlassian.jira.component.ComponentAccessor def cfManager = ComponentAccessor.customFieldManager def issueManager = ComponentAccessor.issueManager def epicLink = getFieldById(getFieldChanged()) def…
-
You could just change this: def options = optionsManager.getOptions(config).findAll{!it.disabled}
-
While I don't have Jira 8 yet ... the ComponentManager has been deprecated for a long time. And you don't seem to be using it anywhere in your script. Probably just some leftover. I suspect the following simplified script will work just fine with identical results: import com.atlassian.jira.component.ComponentAccessor def…
-
Can't you just use the built-in script: https://scriptrunner.adaptavist.com/5.5.7/jira/builtin-scripts.html#_copy_custom_field_values
-
Without actually testing it, the following removes your compilation errors: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.user.ApplicationUser import com.atlassian.jira.workflow.TransitionOptions def…
-
Part of the trick here is that with Jira 7 ... a new Priority Scheme has been added to projects and just filtering from the list of all priorities obtained from constantsManaeger.getPrioririties() will return more values than are in your project. Also, since you are interested in project role rather than jira admin , we…
-
I think your error is here: link.issueLinkType.name this will return "Blockers" or whatever name you have for the link type. Not the directional name. For that, you want link.issueLinkType.inward So try if (linkType.contains(link.issueLinkType.inward)) {...} This should result in the Done button being hidden.