Skip to content

add $link_type parameter to Issuelinks api.  #485

Closed
@thawkins

Description

@thawkins

can we change the issue-links API to have the following.

This allows setting the link_type as "relates_to", "is_blocked_by" or "blocks" in the latest 12.7 versions of gitlab, it is silently ignored and defaults to "related_to" for earlier versions of gitlab, causes no code api breaks.

    /**
     * @param int $source_project_id
     * @param int $source_issue_iid
     * @param int $target_project_id
     * @param int $target_issue_iid
     * @param string $link_type
     * @return mixed
     */
    public function create($source_project_id, $source_issue_iid, $target_project_id, $target_issue_iid, $link_type = 'relates_to')
    {
        return $this->post($this->getProjectPath($source_project_id, 'issues/'.$this->encodePath($source_issue_iid).'/links'), array(
            'target_project_id' => $target_project_id,
            'target_issue_iid' => $target_issue_iid,
            'link_type' => $link_type               // New parameter for link type
        ));
    }
Attribute Type Required Description
id integer/string yes The ID or URL-encoded path of the project owned by the authenticated user
issue_iid integer yes The internal ID of a project’s issue
target_project_id integer/string yes The ID or URL-encoded path of the project of a target project
target_issue_iid integer/string yes The internal ID of a target project’s issue
link_type string no The type of the relation (“relates_to”, “blocks”, “is_blocked_by”), defaults to “relates_to”).

see: https://gitlab.com/gitlab-org/gitlab/issues/2035

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