Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hey,
I would use transitions but there is no transition before 'create' of course ;-)
We have different security groups that would need to have different default values based on those groups (levels are also configured).
What is the best approach?
(the fields that need a different default value are non default fields so https://marketplace.atlassian.com/plugins/com.gebsun.plugins.jira.defaultvalues/server/overview doesn't help much)
Thanks for ideas/pointers/solutions :)
S.
In the end we did it like this:
-> after the create there are a couple of automatic transitions
Because after reading the answers to this question not that much hope was left for having different default values based on security level...
We leave those fields empty and (indeed) after (other) post functions we set the values (based on security level) (with a groovy script)
It's not exactly the answer to the question but it is something we can live with...
Thanks for all of the input,
S.
Hey @Sander Theetaert,
You can actually change the default value of custom fields based on security level during the create transition (and NOT using a POST function) with the Power Scripts add-on.
Here's a short video tutorial that walks you through exactly how to do this.
And here's sample code that you can use, but feel free to tweak to match you needs:
if(securityLevel == "Developers") {
string steps;
steps = "The following steps must occur in order to complete this task:\n";
steps += "# Make an Observation. Scientists are naturally curious about the world. ...\n";
steps += "# Form a Question. After making an interesting observation, a scientific mind itches to find out more about it. ...\n";
steps += "# Form a Hypothesis. ...\n";
steps += "# Conduct an Experiment. ...\n";
steps += "# Analyse the Data and Draw a Conclusion.\n";
desc = steps;
}
Hope that helps!
Thanks,
Johnson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That video says it is a workflow post function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And it doesn't change the defaults in the fields, just updates the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How is the security level for the issue set?
You can use a custom post function on the Create transition to do things after that is known
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The security level is based upon the account (so certain users have a certain security level)
The fields that need a default value (based on that level) need to have this value already set before the create action (in the create issue screen) so a post function on the create is to late...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Security levels in Jira are based on what a user enters into the "Level" field when creating or editing the issue.
There's no way you could base defaults on the security level because
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.