Skip to content

GraphQL IssueType returns work item path if task

Mario Celi requested to merge 356627-task-specific-work-item-url into master

What does this MR do and why?

Issue type has a webUrl and webPath fields. These fields will now return the work items url if the presented issue is of type task

Related to #356627 (closed)

How to set up and validate locally

  1. Run bundle exec rails console
  2. Run Feature.enable(:work_items)
  3. In the console make sure to fetch the IID of an issue with issue.update(issue_type: 'task')
  4. Execute a GraphQL query like
{
  project(fullPath: "gitlab-org/plan-stage/test-project") {
    issue(iid: "74") {
      id
      webUrl
      webPath
    }
  }
}

You should get a path like "http://localhost/group1/project1/-/work_items/49".

If you disable the feature flag or the fetched issue is not of issue_type task, you should get an issue path like

https://gitlab.com/gitlab-org/plan-stage/test-project/-/issues/1"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading