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 votes

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 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,234 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