Forums

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

JIRA Java API: how to add an issue type to a custom field?

Michele Zamparelli July 9, 2018

Hi,

I can retrieve custom fields using the CustomFieldManager, and I can get the list of used issue types using the CustomField.getAssociatedIssueTypes() method.

But how can I *add* an IssueType to a CustomField ? I guess I need some form of persistence, but how ? Can anyone point me to existing articles/documentation?

 

thanks.

2 answers

1 accepted

0 votes
Answer accepted
Tarun Sapra
Community Champion
July 9, 2018

Hello @Michele Zamparelli

You can't just add an single issueTYpe to an custom field configuration, you have to add an "context" which contains list of projects/issueTYpes mapped to that custom field.

Please see some samples (using script runner - groovy)

https://community.atlassian.com/t5/Jira-questions/How-to-add-project-to-custom-field-s-context-using-Script-Runner/qaq-p/332025

0 votes
Michele Zamparelli July 11, 2018

Thanks Tarun, I think the link you mentioned and a cursory inspection of the CopyProject.groovy from Jamie gave me the info I needed.

I still find this part of the API usage rather obscure and would welcome if Atlassian would spend more effort in shedding some light upon it.

thanks.

Suggest an answer

Log in or Sign up to answer