Can I add condition to the "create issue" action in Jira Behaviour?


I want to add the following behaviour to a workflow:

- Hide a field when user is in a certain group AND when issue is being created.

The first condition was quite simple to include. However I'm having troubles with the latter.

I have chosen a guide workflow which has the "create" action (I believe every workflow in Jira has this action), but this action does not appear in the Workflow Action list box.

Any tips?


4 answers

1 accepted

You have to write code to do it rather than choose options from the web UI.

You would use:

getActionName() == "Create" && <your code to see if the current user is in group X>

Hi Felipe,

you can't add a condition to the create transition. There are only validators and post functions possible.



However you could remove a field in the create screen.

Thank you for your answer Udo!

However you did not read my question carefully enough.

My question is related to the Jira Behaviour Plugin. So the condition I've mentioned is not a Workflow condition.

I could remove the field from the create screen, however I would like this field to appear on the screen if the users are not in a certain role.

Well, your question is quite ambiguous since your talking about 'create' and Workflow action as well as 'add the behavior to a workflow'.

However, maybe Ramabanams answer fit your need.

Good luck.

you can hide field for specific group by using following javascript, i suggest to add it as webresource in a plugin

&lt;script type="text/javascript"&gt;  
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
function hideField(){
var issueTypeCreate =document.getElementById('issuetype-field'); 
var issueType =$('#issue-create-issue-type').text();
if((document.getElementById('customfield_10571') != null  || (issueTypeCreate!=null &amp;&amp; issueTypeCreate.value == "Defect") || issueType == "SVN Kit"){
        var user=getCurrentUserName();			
		if(isUserInGroup(user,'Developers') ){
			//to hide field
		}else  {
		/to show field

function getCurrentUserName()
var user;
        url: "/rest/gadget/1.0/currentUser",
        type: 'get',
        dataType: 'json',
        async: false,
        success: function(data) {
            user = data.username;
     return user;
function getGroups(user)
var groups;
        url: "/rest/api/2/user?username="+user+"&amp;expand=groups",
        type: 'get',
        dataType: 'json',
        async: false,
        success: function(data) {
            groups = data.groups.items;
     return groups;
function isUserInGroup(user, group){
    var groups = getGroups(user);
    for (i = 0; i &lt; groups.length; i++){
         if (groups[i].name == group){
              return true;
    return false;

is there a chance to get this as a feature in a future version of JIRA?

Do you mean a future version of the plugin? If so you are able to do that now... maybe I'm missing something, or perhaps your answer doesn't relate to the question?

Argh, I'm sorry. I was posting in the wrong tab.

Thanks for the quick response and sorry for the confusion

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,180 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you