Comments
-
Try usuario.key instead of usuario.name in the WorklogImpl constructor. With newer versions of jira, user.key and user.name are not always the same and the contructor says it;s expecting "authorKey" https://docs.atlassian.com/software/jira/docs/api/8.5.1/com/atlassian/jira/issue/worklog/WorklogImpl.html
-
Can you please expand on what/why it doesn't work? What errors or debug statements do you see in the log? Which field is this script added to in the behaviour configuration? If you look at this page in the documentation you will see a warning that issueParentId is not available in the initializer for new sub-tasks: As…
-
Since you mentioned "need to assign in a transition", I'm assuming you have this script in a post Function? If so, what may be happening is that you update the issue with your script, then the issue object already present in the transition is used to overwrite the change you just made. Without making any changes to your…
-
If my answer helped you, I'm glad it did. To help others find it, can you please click the "Accept Answer" button? Thanks
-
Unfortunately, that's every user. It used to be that those validation errors would go completely unnoticed and behaviour was unable to prevent submitting the form if errors were present on hidden fields. So perhaps they've made some inroads into fixing that, but that causes the message to not be placed against the correct…
-
I see nothing abnormal there. More importantly, it's clear that the helptext doesn't include the (:). The only other thing I can think of is to check your "configure field" option on the screen and make sure you have ShowFields = All. I've seen behavior misbehaving (ha!) when custom field selections have been made. If…
-
I would suggest also examining the api calls from your browser development panel. Look at the response from GET: validators.json Then look at the payload and response from POST: runvalidator.json You might be able to find some clues there.
-
Nevermind that last point... I see you have an actual option called Please Select. Do you perhaps have another behavior configuration that tried to do the same thing? I'm wondering where the ":" colon is coming from in :Remove the "Please Select.." option
-
Yeah, I'd try this first. This is not a situation I've seen directly. My guess would be that perhaps you have 2 fields with the same name and behavior is picking the wrong one. Though before, in the situation where the field that the error is set on is visible on the screen, my experience was that the error was simply not…
-
While it may work, I don't think it's a good idea to use<= on a string value, I'd recommend you work with integers. You don't need to convert your date to sting then parse it with substring, just use the built-in date object methods like getDate() and getMonth() For example def currentDate = new Date().minus(10) def…
-
If you want to access specific capture groups in your matcher, you need something like RegExResult[0][1] If you run this in the console def test = "something Member Number: } 112346 something else" def RegExResult = test =~ /Member Number:.*?} ([1-9][0-9]{4,22})/ RegExResult[0] You will get an array result like this:…
-
Scriptrunner I think used to be called "groovy runner" ... so really it's only groovy/java. But a groovy script can execute a command on the server just like you would from the command line. So if you want to run a python script, you can do something like this: def sout = new StringBuilder() def serr = new StringBuilder()…
-
My pleasure and good luck. Please be sure to accept the answer. I don't usually ask, but I think I've earned it ;) Happy scripting!
-
Hi @John_Diaz Looking at the console output, I see that the custom field contains "LazyLoadedOptions" object which is the same type of data that is stored in a build-in single select field. So since cfTargetSystem will be such an object, to get the actual text of the option, you would use cfTargetSystem.getValue()…
-
We're getting there.... Try the console code again but remove the extra double-quote we can make sure if .value is needed at the end of cfTragetSystemRequest. But since it appears to work, that error can likely be ignored. These sorts of static type checking errors are not always indicative that something needs to change.…
-
Ah, our messages crossed. With the custom field being provided by an add-on, it's difficult to know what value will be returned by issue.getCustomFieldValue(cf) Can you please try this in the console (replace the ticket number with a valid ticket that has a value in the custom field import…
-
I had to look something up on the detection of automatic assignee This should work: import com.atlassian.jira.component.ComponentAccessor def systemUserMap = [ JIRA: "jira_team_user", Confluence: "confl_team_user", "Splunk API": "splunk_team_user", ] if(webwork.action.ActionContext.getRequest().getParameter("assignee") ==…
-
Ah... yes... that error (just a warning really) was in your original script and I didn't validate it since I was focused on "how to add another condition" This is letting you know that the getUser() method is no longer recommended and will disappear at some point. So might as well fix it now. def assignee =…
-
Hi @John_Diaz You need a comma after the confluence item in the systemUserMap Like this: def systemUserMap = [ 'JIRA' : 'Jira Team', 'Confluence': 'Confluence Team', //<- comma was missing here 'Splunk API': 'Spluk Team' ] Map objects are a bit like arrays in groovy: def array = ['item1', 'item2', 'item3'] def map =…
-
Can you include a screenshot of your transition's post function configuration?
-
If you have spaces in the system name line "Splunk Correlation", you must put quotes around it.
-
If you want to have jira take care of indexing itself, use IssueService instead of issueManager to do the update. It requires a couple of extra steps, but it's generally safer and will ensure that permissions are respected. Otherwise, you will have to get an IssueIndexingService object and reindex the parent issue after…
-
@Robert Giddings _Adaptavist_ I suspect he wants to allow admins to edit scripts in workflows etc, but restrict access to the console only. Using the permission mechanism, admins would lose the ability to edit all scripts.
-
Hi @Adrien SITTER What happens with your script? I see nothing wrong with it. What version of Jira are you on? When I run this script (which uses all the same components your does) in my console, I see the flag added to the board on the specified issue import com.atlassian.jira.component.ComponentAccessor import…
-
Try to convert your value to a double before making math operation: return value.toDouble() * 250 Or get it as a double in the first place def value = (Double)issue.getCustomFieldValue(customField);
-
You might be able to achieve this with some scripted fragments. 1) a custom web panel wit a condition based on the current user's attribute to insert a meta tag that will indicate if the user has permission to the console or not 2) a custom javascript resource that includes some simple javascript to examine the meta tag…
-
setCustomFieldValue(issuepicker, value) only sets the mutable issue object (in memory) to the specified value. That should normally be followed by updateIssue() In a listener, to update a custom field, there are 3 general methods that I'm aware of * IssueService - validateUpdate() then update() * IssueManager -…
-
It kinda depends where you want to execute this script. Is this a postfunction, listener or somewhere else?
-
Sorry, I don't know. I've never worked with outlook mail. But if you can get a file object, you should be able to look a the "length()" attribute.
-
First, I would be remiss not to mention that Components already provide this exact feature. If you create JIRA and Confluence as components in your project and set the component leads accordingly, the assignee will be set in this order 1) user-selected assignee, 2) Component Lead, 3) Project Lead Assuming, you have a valid…