Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch list custom field contexts for a field using query?

Pratibha Tambakad April 13, 2023

Hello Team,

I am trying to fetch the list of project contexts for a field. Tried many ways but couldn't get the expected result. Could you please help out?

1 answer

1 accepted

1 vote
Answer accepted
Sachin Dhamale
Community Champion
April 13, 2023

Hi @Pratibha Tambakad ,

 

Do you want to take the context  programmatically or from UI?

 

Thanks,
Sachin

Pratibha Tambakad April 13, 2023

Hey Sachin,

 

I want to get it from DB. I am trying the query from script runner UI now, If it works I have to get the data from DB

Sachin Dhamale
Community Champion
April 13, 2023

@Pratibha Tambakad ,

Refer this Doc

You can use this query to get the context associated with specific custom field

select * from fieldconfigscheme where FIELDID in (customfield_10001);

If you want for all field then 

select * from fieldconfigscheme

 

Accept the answer if it helps

Pratibha Tambakad April 13, 2023

Hey Sachin,

This I tried already but receiving the below error:

error.PNG

Sachin Dhamale
Community Champion
April 13, 2023

Can you give the customfield id in double quote and try

Pratibha Tambakad April 13, 2023

No, It didn't worked getting the same error

Sachin Dhamale
Community Champion
April 13, 2023

try to run 

select * from fieldconfigscheme

Pratibha Tambakad April 13, 2023

This doesn' t give expected resultTest1.PNG

Sachin Dhamale
Community Champion
April 13, 2023

Hi Pratibha,

 

This is the table where custom field context information being store.

either you can extract this information in excel then then apply the filter based on fieldid so you get the context of specific custom field

Or

Apply the where condition in the select query for specific custom field

Pratibha Tambakad April 13, 2023

Hey Sachin,

Yes , we can filter in excel not sure in query it's not retrieving but is it possible to get the assosciated project key as well with the contexts?

Sachin Dhamale
Community Champion
April 14, 2023

Hi Pratibha,

 

yes you will try this one 

select * from configurationcontext where fieldconfigscheme=10031;

Here 10031 will be id which you will get from previous query

Refer this Doc for more information

Like Sanjen Bariki likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events