Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,060
Community Members
 
Community Events
165
Community Groups

How to use Automation for Jira to populate a custom field upon Issue Creation?

I have been trying since February 1st to work with my Jira support team to get automation working so that I can set a custom field on our Issues page to be automatically set -- I've dumbed down the automation to just have it set the "Categories" custom field to just be P3 for now until I get it working correctly, then I will add some additional logic to also read the Summary field to see if P1 or P2 is mentioned.

I have tried 42 different ways to get this to populate and nothing has worked -- below is a screenshot of my latest failure.  I know the custom field ID as well as the ID behind the P3 value.

Can anyone help me figure out how to get this to work so that I can move on?

 

Screen Shot 2019-02-18 at 2.30.17 PM.png

2 answers

1 accepted

2 votes
Answer accepted

Don't use set entity property but instead use the action for Edit Issue. Then you can select the field (sounds like you called it Categories) to set and what you want to set it to ("P3"). Properties for Jira issues are hidden items tied to an issue behind the scenes, and not something you would see in a custom field. Hope this helps.

Hi Ryan, I tried that as well but the custom field Categories doesn’t show on the Edit Issues - is there a way to get a custom field to show there?

There could be several reasons it wouldn't show up for the automation tool under an Edit Issue option. One of the best assists would be for you to go to that issue types Create screen and click on the Where is my field? helper. It should be somewhere in the upper right of the window for creating the issue. The reasons you might not see it could be: 1) It is out of scope (wasn't made available for that issue type), 2) Wasn't added to the Create screen for project / workflow it is in.  I believe there are a couple more but can't think of them off the top of my head so early in the morning. The Where is my Field? is a big helper though. You just enter the field you're looking for and it can likely point to what was overlooked.

Thanks again for your time Ryan.  I'm not an administrator so I can't see everything that goes on behind the scenes, but the Categories field shows up on the Create Issue and Edit Issues screens, but is not available in the Edit issue Automation.  Is there something specific I can tell my administrators to look for that they need to set for it to be available via Automation?

Let's see. It shows up on those screens for sure then so it is available for the project you're setting it up for and the right issue type.

Honestly, I see fields showing up in the drop down in automation that aren't even for the project I have a rule limited to. Software project fields showing up in service desk rule. Their context is global, but I tried editing the context to restrict to see if that might be affecting you. At least in my instance (jira server) I could still pull up the field.

Did the admins perform a re-index after creating the field? I am not sure what else might be causing it to not show up at this point.

Thank Ryan, your feedback helped point me in the right direction!

Here's how I resolved:

Used the Project Automation, chose to do a new Edit issue action, but where I couldn't select the field, I could use the More options and entered the following into the additional fields text box:

{
"fields": {
"customfield_11002": [{"self":"https://jira.pythos.pythian.com/rest/api/2/customFieldOption/11070","value":"P3","id":"11070"}]
}
}

Tested it out and it worked!  Now I can write the logic to set it to other values based on the contents of the Summary field too!

Woot!

Like # people like this

Glad it all got sorted. Best of luck!

Hi, I've actually been looking for an option to raise the existing priority. I can see how to set it to an exact priority option but how can I just raise it regardless of what's the current priority?

That should likely go into a new request. It sounds pretty unrelated to setting a custom field at issue creation.

@Ryan Gillespie I would like to ask is security level (the field) cant be edited in automation page?
Since I am trying to build an automation of assigning the security level for the issue when the issue is created. (btw I add the security level field to my custom request type of the incident issue type)

When I look at the Edit Issue the action, one of the fields is Security Level that can be edited. From the sound of your question, your trigger would be On Issue Creation, then you build in whatever logic for IFs, then your action would be Edit Issue and change the Security Level.

Hi all,

I am facing same/similar issue now. However, i have tried with More Option => JSON but Jira constantly complains about JSON not being valid.

 

I am trying to update the Cascading field: Category - SubCategory

It's enough to add only value for Category so this is what I am trying first.

 

Here are the formats I have tried and failing so far:

attempt1:

{
"fields": {
"customfield_16401": {
"self":"https://jira.activevideo.com/rest/api/2/customFieldOption/16506",
”value”:”AppCloud”
    }
  }
}

 

attempt2:

{
"fields": {
"customfield_16401": [{
"self":"https://jira.activevideo.com/rest/api/2/customFieldOption/16506",
”value”:”AppCloud”]
    }
  }
}

 

attempt3:

{
"fields": {
"customfield_16401": {
"self":"https://jira.activevideo.com/rest/api/2/customFieldOption/16506",
”value”:”AppCloud”,"id":"16506"
    }
  }
}

 

When I try to open the URL - it works

Screenshot 2020-09-23 at 13.36.49.pngScreenshot 2020-09-23 at 13.36.43.png

I have the same ERROR:

Action details:

Edit issue

Error while parsing additional fields. Not valid JSON.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Coming Soon: Insight Changing to Assets

The 2020 acquisition of Mindville added powerful asset and configuration management capabilities to Jira Service Management in the form of Insight. Following the completion of that integration, custo...

241 views 1 9
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you