Comments
-
An update to the script, which is more efficient: def hasFieldChanged = changelog.items.any { it.field == "Change type" } //Replace with your monitoring field name if (hasFieldChanged) { def fullChangelog = get("/rest/api/2/issue/${issue.key}/changelog") .header('Content-Type', 'application/json') .asObject(Map) .body…
-
This information is actually in the issue's history. Anyway, you can achieve this using ScriptRunner's Script Listeners. To do that: 1. Navigate ScriptRunner > Script Listeners > Add Listener > make appropriate configurations 2. Under "On these events", choose "Issue Updated" or any events suitable for your use case. 3.…
-
sorry about that, from the documentation I mentioned, you need to use component id: setComponentIds(component.id)
-
To set component in IssueInputParameters, use setComponentIds(). In your case, you use replace: setComponent([component]) with: setComponentIds(component) You should take account of cases with multiple components if applicable. I hope this helps!
-
Hi @Laci This should work (I also make the script more consistent and clearer): def ReviewedDate = getFieldByName("Reviewed Date") def Reviewed = getFieldById(getFieldChanged()) if (Reviewed.getValue() == "Yes") { ReviewedDate.setHidden(false) ReviewedDate.setRequired(true)…
-
The important part is how to set current date on a Date Picker field: getFieldById(getFieldChanged()).setFormValue(Calendar.getInstance().format("d/MMM/yy"))
-
1. Did you change "yourSelectList" to the name of your select list? 2. Is your option value name "yes" or "Yes"? 3. What do you mean by it will not allow you to add a date? 4. Is Reviewed Date field a Date Picker field? Can you post your original Behaviour script in text on how you make Reviewed Date field appears as well…
-
Assuming Reviewed Date is a Date Picker field, you can attach following Behaviour snippet to the field: if (getFieldByName("yourSelectList").getValue() == "yes") { getFieldById(getFieldChanged()).setFormValue(Calendar.getInstance().format("d/MMM/yy")) } else { getFieldById(getFieldChanged()).setFormValue(null) } This will…
-
like @PD Sheehan posted. You need to use setRequired(true/false) to set the field required.
-
I have tried: getFieldById("issuetype").setError("Error Message.") getFieldById(getFieldChanged()).setError("Error Message.") They both work. It might be a bug, you might want to upgrade your ScriptRunner.
-
Assuming you have a simplified workflow and you are using Simple Scripted Validator, under condition use: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.security.roles.ProjectRoleManager def prm = ComponentAccessor.getComponent(ProjectRoleManager) def status = issue.status.name def isR1 =…
-
Hi @Ian Balas You can refer to this documentation on how to retrieve the parentIssue properly. I can confirm it does work. I hope this helps! Max
-
The getFieldByName() on cascading custom field returns an ArrayList. Therefore, to access the cascading custom field values in Behaviour, you can just use: def parentOption = getFieldById(getFieldChanged()).getValue()[0] def childParentOption = getFieldById(getFieldChanged()).getValue()[1] I hope this helps!
-
If you just want this information in text (json), you can request this url: http://yourbaseurl/rest/api/2/field This will return all fields information. You can also programmatically query this information using Jira API. Run this script in ScriptRunner > Console: import com.atlassian.jira.component.ComponentAccessor…
-
You are most welcomed. Please accept my answer for future reference.
-
I am sorry, you need to import the appropriate class: import com.atlassian.jira.event.type.EventDispatchOption issue.setCustomFieldValue(customField, null) ComponentAccessor.getIssueManager().updateIssue(ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser(), issue, EventDispatchOption.ISSUE_UPDATED, true)
-
Tell me please. How can I delete the value in the picker field with multiple issues after filling in the links? You can set the field to null and update the database like so: issue.setCustomFieldValue(customField, null)…
-
1. Since you are using a multiple issue picker field, the return type of the field is a list of Issue objects, so please try: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.link.IssueLinkTypeManager import com.atlassian.jira.issue.Issue final def linkName = "мероприятия" def…
-
Your request is not exactly clear but from what I read on your script. You are probably using a post function on a create transition. 1. Have you moved your post function order to be after "Creates the issue originally."? 2. You might want to use doAfterCreate {} closure too if you are using "clone an issue, and links".…
-
First Warning You can use the binding variables available (marked with arrow) for you to put in the appropriate variables: With proper variables, this revised version should work for you: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.link.IssueLinkTypeManager import…
-
Once the Support Request is approved, it auto creates a task. Assuming you create this Task issue with post-function when Support Request issue is approved, as an example, you can extend the post-function to link the created Task to the original Epic with following script: import…
-
I didn't think you want to edit issue. You can implement the same script as a listener on Issue Created and Issue Updated events: 1. Navigate ScriptRunner > Listeners > Create Listeners > Custom Listener. 2. Choose appropriate project, and choose Issue Created and Issue Updated events. 3. Under script: replace "issue" with…
-
I have made some tests. The newly filled to-be-created version can't be retrieved with Behaviour. Looking at your script, your use case can probably also be achieved with post-function. 1. Navigate Project Settings > Workflows > edit the appropriate workflow > click on Create transition > Post Functions > Add post function…
-
There are many ways to do it, you can do it with string manipulation methods: def versions = getFieldById("versions").value.toString().replace("[","").replace("]","") def justText = getFieldByName("Just Text").value.toString() getFieldById("summary").setFormValue("${justText}_${versions}")
-
The id for Affect/s Version is "versions". Also, you can simply use something like: def versions = getFieldById("versions").value.toString() def product = getFieldByName("Product Techno").value.toString() getFieldById("summary").setFormValue("${product}_${versions}")
-
I have tested that the latest version of Jira (8.15.0) doesn't includes Automation for Jira app. The included app is Advanced Roadmaps for Jira. As @mogavenasan said, this can be definitely achieved with ScriptRunner.
-
The error occurs because you did not have a "Just text" custom field in your parent issue. You need to replace "Just text" with the name of your intended select list custom field name.
-
Unfortunately, I can simply recommend the feature. The rest is beyond my experience. As I mentioned, I don't think your use case requires such advanced feature.
-
Have you taken a look at the documentation: Web Item: Dialog (advanced)? It have a simple example for you to build on. You need to build your dialog from ground up though. You can certainly setup a transition screen with multiple list custom fields and create your tasks via ScriptRunner's post-function/listener, and even…
-
I tested it, this will work even when you are just viewing the issue and inline edit. Try it yourself. 👍🏻 Just remember to refresh your issue viewing tab after saving the behaviour.