Comments
-
Newest versions of scriptrunner do fire behaviours scripts on insight field changes. Though it doesn't yet from service desk portal screens. Try to upgrade if you haven't in a while
-
Try something like this import com.atlassian.sal.api.component.ComponentLocator import com.atlassian.confluence.security.SpacePermission import com.atlassian.confluence.security.SpacePermissionManager def spacePermissionManager = ComponentLocator.getComponent(SpacePermissionManager) def oldGroupName = 'yourOldGroupName'…
-
Behaviours formField.getValue() on an insight field will return either a single Object Key, or an Array of Object Keys depending on whether the field allows multiple or not. So you can either get the key for the object that you want to trigger your behaviours and hard code that, or programmatically retrieve an ObjectBean…
-
That looks like a scriptrunner for jira Server/Data Center script ... but you tagged your question as cloud. You can't import jira server api classes into scriptrunner cloud script. I'm not sure what the equivalent script for cloud would be.
-
That's mysterious... Regarding component condition... try issue.components.any{it.name == 'Jira Service Desk'} //or issue.components.every{it.name == 'Jira Service Desk'} That's because issue.components should return a list of ProjectCopmonent objects. you want to compare the name of those objects.
-
Yes that's possible. You can either use the form-base configuration in behavior and select those fields. Or if you want to access them via scripts, you'll use the getFieldById() method. There are different ways to identify the field id. I personally like to just examine the page html using the browser developer tools. Open…
-
I've only used this configuration directly in a workflow post function. Since you are only firing on a single project and workflow event, that might be a better place for it. But I would try to add the following to condition (just to be sure) log.info "Evaluating condition for Move to Pending Event: $event.issue" true That…
-
Can you include some screenshots of your configurations? Are you positive that the last field in the form is correctly populated: Issue Link Type / Direction If you leave that blank, no links are created between the original and cloned issue. If that's correct but you still don't get links, make sure the "run as" user has…
-
Actually, no, you don't have to rely on the fixed email address using the "Send a custom email" script listener. You can use the "Condition and Configuration" script to set your recipients. In that script, there is a "mail" variable in the binding. So you can parse the comment there and then set mail.setTo("your…
-
Yes that's possible with scriptrunner. But dealing with workflows and transition is one of the slighly more involved/complex scripts. You'll want to use a custom scripted listener with the Issue Commented event It will look something like this: import com.atlassian.jira.component.ComponentAccessor import…
-
That looks like perhaps the built-it JSON serializer in the HttpBuilder is getting confused. I don't know if the RESTClient can work like that, but you can try to serialize the body yourself and send it as plain text. Something like this import groovy.json.JsonBuilder def jsonBody = new JsonBuilder(body).toPrettyString()…
-
@Jonny Carter do you have any thoughts on how to deal with shared drafts that might not have been published when doing this sort of bulk update? The draft version will not have these updates. So the next time someone opens the page for editing and they publish, the changes introduced with this method will be lost. I'm…
-
You'll want to use the ChangeLogUtils for that Here is a couple of sample functions that uses that: import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.history.ChangeLogUtils import com.atlassian.jira.issue.util.DefaultIssueChangeHolder import…
-
I don't use the cloud, but I assume that this should work (near the top) if (input1 == 'NOT APPLICABLE') { return }
-
Hi there Taking you at your word that you want field C to be required when a.1 is selected and at the same time b.3 is selected, you could try a script like this: def fieldA = getFieldByName('A - Test') //this is the label for the field A def fieldB = getFieldByName('B - Test 1') def fieldC = getFieldByName('C - Test 2')…
-
This is caused by this bug: https://productsupport.adaptavist.com/browse/SRJIRA-2665 (created as a result of a support request I sent them). My guess is they load some javascript resources to "listen" to the web-item click. But this resource is not available in all issue view contexts. It's possible to work around it by…
-
I found this question when searching for some usage of ApplicationAuthorizationService. This helped me. But I think I might be able to help anyone else that has the same issue as the original poster. Here is my guess as to what is happening. * Application access is derived from group membership * Group membership can only…
-
Manually re-indexing is not something that should need to be triggered manually very often. Usually, that only needs to be done if you've made significant configuration changes. Every time an issue is created or updated via the application, that issue's index should get refreshed. A full re-index can take time on large…
-
I moved your post for you. My guess is that something is happening with your indexing. Try to re-index your project to see if the issues will start appearing. Then, you'll have to track down why certain issues are not getting indexed. Are they being created by some automation? Are there other errors perhaps visible in the…
-
In your initial call to get links, why don't you just filter by both the link type and the linked issue type? def linkedIssues = issueLinkManager.getOutwardLinks(issue.id).findAll { it.linkTypeId == issueLinkType && it.destinationObject.issueType.name == linkedIssueType }
-
I'd recommend you become familiar with string management methods in groovy. Here is a good place to start: https://groovy-lang.org/syntax.html#all-strings But basically, there are many ways to define strings: * 'single quoted string' * "double-quote string" * '''triple quoted string''' * """triple double-quoted string""" *…
-
The "raise issue on behalf of" in the customer portal is really the same as the reporter field in regular jira. So... def reporterFld = getFIeldById('reporter') def reporterName = reporterFld.value ... will get you the username of the reporter and you can use that in your jql.
-
I don't have access to it, but it should be fairly simple to recreate the input and response. Here I took a small stab at it: import com.atlassian.jira.web.bean.PagerFilter import com.atlassian.jira.bc.issue.search.SearchService import com.atlassian.jira.component.ComponentAccessor import…
-
You didn't specify cloud/dc... But with server/dc, your first scenario can be accomplished with behaviour. For cloud, I don't think it's possible with scriptrunner. I don't use cloud, so I can't be sure and I don't know what other apps out there may or may not help with this. As for the second scenario... you need at least…
-
Try adding log.debug groovy.xml.XmlUtil.serialize(request.body) This will confirm that the .send() method worked and received a wslite.soap.SOAPResponse and show you the full xml of the body Then assuming the response match the XML you provided above, you should see that the first node in your xml: ns0:CreateResponse So…
-
To be honest, I did not test this and wasn't 100% certain it would work. But based on the documentation saying "if you want to override some of the field values rather than have them inherited from the source issue you can specify that in the Additional Code" I was pretty confident it would work.
-
I don't think that's possible using the built-in issue picker. But you might be able to achieve a similar purpose by using a plain text field and a conversion to a select list. This would require you to build a custom rest endpoint that mimics the built-in /rest/scriptrunner-jira/latest/issue/picker but ignores the current…
-
You say you are getting too many errors in the provided example, but you also claim that you can do the request successfully. Can you share how you do this successful request? Is it using a different code example? If you can load the "response" variable correctly and it is loaded with an xml that matches the response you…
-
Why don't you use the built-in function and use the additional issue actions to change the project from the default selected in the form? import com.atlassian.jira.project.ProjectImpl def cf = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == 'Supporting Project'} def project =…
-
I don't think that scriptrunner is aware of, or compatible with worglogpro custom fields. You would have to open an enhancement request with Adaptavist.