Comments
-
By the way, you can add log.error lines to see whether your calculations are OK. log.error("ImpactIntValue: $ImpactIntValue") log.error("LikelihoodIntValue: $LikelihoodIntValue") etc. You will see the logs in the Logs section
-
Is this post function? Where are you using this script?
-
Have you checked the issue if it was updated? Since your code does not return anything, it is normal to see null in the Result section.
-
Don't forget to add this import statement to the top line import com.atlassian.jira.issue.MutableIssue
-
Can you please try this? MutableIssue missue = (MutableIssue) issue missue.setCustomFieldValue(RPN,RPNValue)
-
Yes, it will work. This is just the variable name, it does not need to be the same as the custom field name.
-
You can't use space characters in your variable definition. Simply change all "Counter MeasuresValue" to "CounterMeasuresValue" , etc..
-
I'm glad that it worked :)
-
Yes, that's what I want ! The script must ignore if the field is NULL, but must work if the field has a value :) then you can use that line. It works exactly this way. Since the code will terminate if the cf value is null, it won't impact the assignee field. For the next run, if the value is not null, then it will update…
-
Sorry, I think I was unclear. The code will work well, but if that custom field value is null, then it won't update that issue, it will just exit the code without errors. But for the other issues which have a value (other than a null value), it will update accordingly. If you want to update the assignee as Unassigned when…
-
This might be a good starting point, import com.atlassian.jira.component.ComponentAccessor def customFieldManager = ComponentAccessor.customFieldManager def cf1 = customFieldManager.getCustomFieldObject(id1) // id of the CF1 def cf2 = customFieldManager.getCustomFieldObject(id2) // id of the CF2 def cf3 =…
-
Hi @Akshith Kumar As of my understanding, these are single-select custom fields and you need to convert them into numbers based on their values: e.g. Catastophic-8 is equal to "8", then multiply all three fields and set it to a number field which is customfield4. Is that what you want?
-
Yes, however, keep in mind that it will immediately break the script. I mean it won't update the issue as it is below the script. If that's your purpose, please go ahead and put that line.
-
These logs are different from what you mentioned above. The problem here is with the code belove String userValue = cFieldValue.substring(cFieldValue.indexOf("<")+1 , cFieldValue.indexOf(">")) The custom field value 'cFieldValue' can be null and you can't do an operation with a null value. So, you have to check if it has a…
-
exactly :)
-
Hi @Aisha M Probably for some events, an attribute is null and your code tries to get a substring of that null attribute. I think it is best to add a null check. If you share your code, I'll try to correct the problem.
-
Hi @Markus Dietrich Welcome to the community! As far as I know, you can't do that without an app. Here, Atlassian recommends using Script Runner's issueFieldMatch JQL function with regular expression. You can use something like issueFunction in issueFieldMatch("", "summary", "^startingword*") Hope it helps
-
@Aisha M in case you did not get a notification :)
-
Yes could you please create a separate post, it became very hard to track. Please do not forget to mention my name :)
-
Hi @Nikita Orekhva Welcome to the community! I am one of the folks behind Time to SLA. If you have any questions please let me know or just raise a ticket here and one of our support engineers will respond as soon as possible. Cheers!
-
Hi @[deleted] You can get the logged user as below. import com.atlassian.jira.security.JiraAuthenticationContext; private final JiraAuthenticationContext authenticationContext; ApplicationUser currentUser = authenticationContext.getLoggedInUser(); Then you can get the user name and store it in a database table for…
-
As I mentioned before, everyone does not need to be good at reading APIs and coding scripts ;)
-
Perfect! I'm glad to hear that. Could you please accept this answer so that it won't be seen as unresolved? Thanks!
-
Hi again @AB Sorry for the delay, the team informed me that they have fixed this problem with the latest 6.20.0 version. Please let me know if you have any issues. Thanks
-
I tested with a multi-select custom field and it disappeared from the screen when I set with an empty list (new ArrayList())
-
That's weird! Is it a multi-select custom field?
-
Hello @Angel Ferreira Have you tried issue.number? As far as I know, issue.getNumber() method returns the issue number as a long value.
-
Hi, @Sahish Sorry for the late response! Jira's system field Component behaves differently than any other multi-select picker custom field. If you set a multi-select custom field with a null value or an empty list, it will automatically be disappeared.
-
It is based on which custom field type it is. If it is text custom field, you can use null. issue.setCustomFieldValue(textCustomField, null)
-
I'm glad that it works. :)