Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Deleted user February 18, 2019

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

3 votes
Answer accepted
Ryan Gillespie February 18, 2019

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.

Deleted user February 18, 2019

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?

Ryan Gillespie February 19, 2019

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.

Deleted user February 19, 2019

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?

Ryan Gillespie February 19, 2019

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.

Deleted user February 19, 2019

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
Ryan Gillespie February 19, 2019

Glad it all got sorted. Best of luck!

Zita Bagi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2019

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?

Ryan Gillespie January 14, 2020

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

andrew t March 2, 2020

@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)

Ryan Gillespie March 3, 2020

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.

0 votes
Marko Vrgotic September 23, 2020

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

Dennis Schlademann January 20, 2022

I have the same ERROR:

Action details:

Edit issue

Error while parsing additional fields. Not valid JSON.
Like B D Oliveira likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events