Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,22 @@ def get_custom_fields(self, search=None, start=1, limit=50):
if limit:
params['maxResults'] = limit
return self.get(url, params=params)

def create_custom_field(self, name, type, search_key=None, description=None):
"""
Creates a custom field with the given name and type
:param name: str
:param type: str, like 'com.atlassian.jira.plugin.system.customfieldtypes:textfield'
:param search_key: str, like above
:param description: str
"""
url = 'rest/api/2/field'
data = {'name': name, 'type': type}
if search_key:
data['search_key'] = search_key
if description:
data['description'] = description
return self.post(url, data=data)

def get_all_available_screen_fields(self, screen_id):
"""
Expand Down