Skip to content

jira.create_custom_field contains wrong key for the cloud #1552

@holle

Description

@holle

When using the jira module to connect to the cloud and attempt to create custom fields via calling:

Help on method create_custom_field in module atlassian.jira:

create_custom_field(name: str, type: str, search_key: Optional[str] = None, description: Optional[str] = None) -> Optional[dict] method of atlassian.jira.Jira instance
    Creates a custom field with the given name and type
    :param name: str - name of the custom field
    :param type: str, like 'com.atlassian.jira.plugin.system.customfieldtypes:textfield'
    :param search_key: str, like above
    :param description: str

The search_key is passed to the REST API by using this key:

        if search_key:
            data["search_key"] = search_key

This does not work sind the cloud rest api requires the key: searcherKey:
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-fields/#api-rest-api-2-field-post

Having a quick peek into the REST API of DC the seems to be same there:
https://developer.atlassian.com/server/jira/platform/rest/v10002/api-group-field/#api-api-2-field-post
https://docs.atlassian.com/software/jira/docs/api/REST/9.17.0/#api/2/field-createCustomField

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions