Sql to find custom fileds Edited

Hello to all.

How can i find witch sql custom fields assigned to project when only specific issue type selected ?

For example. For any new issues of PRJ1 no custom fields required.

For any new issues of PRJ2 if Task type defined then Filed1 custom filed required otherwise none.




2 answers

0 vote

That is not a simple question.  Your SQL will need to read the field contexts, screen schemes and field configurations to work out what might be available on create (and, obviously, the screens could be different for edit.  Oh, and the workflow, you'll need to check workflow screens)

Then for the "fields required" bit, you will have already read the field configuration, but you'll need to check the workflow for any "field is mandatory" conditions or validators.

Are you sure you want to do this with SQL?  As it's the worst possible approach...

Any suggestions other than SQL ?

Im open minded. :)

Here is my case.

I build an outlook plugin which creates via SDK issues on Jira. 

So far so good.

But for some projects when opening new issue type example BUG a custom field named "Effect" required.

So if user selects this project and this type than i need to ask this extra field value.


So i need to know when and what  field required

Thank you in advance for your time  

Use REST - you'll need to be doing that to create the issues anyway (unless you're emailing the issues to JIRA and using your own mail handler to parse the fields)

See https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-discovering-meta-data-for-creating-issues - it shows you how to get a full list of fields and their "required" flag from the project and issue type.

It is a couple of calls, but that's a lot easier to do than building sweeping SQL statements!

Ok thank you very much. I will try and hopefully will work 

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,319 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot