{"record":{"id":"533a0e0ae92b8d9a","repo":"gitlabhq/gitlabhq","slug":"only-project-level-work-items-can-be-created-to-re","errorCode":null,"errorMessage":"Only project level work items can be created to resolve noteable discussions","messagePattern":"Only project level work items can be created to resolve noteable discussions","errorType":"exception","errorClass":"Gitlab::Graphql::Errors::ArgumentError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/work_items/create.rb","lineNumber":149,"sourceCode":"          widget_params: widget_params\n        ).execute\n\n        check_spam_action_response!(create_result[:work_item]) if create_result[:work_item]\n\n        {\n          work_item: create_result.success? ? create_result[:work_item] : nil,\n          errors: create_result.errors\n        }\n      end\n\n      private\n\n      # Overridden on EE\n      def check_feature_available!(container, type, params)\n        return unless container.is_a?(::Group)\n\n        if params[:merge_request_to_resolve_discussions_object]\n          raise Gitlab::Graphql::Errors::ArgumentError,\n            _('Only project level work items can be created to resolve noteable discussions')\n        end\n\n        return if container.allowed_work_item_type?(type.base_type)\n\n        raise_resource_not_available_error!\n      end\n\n      def params_with_resolve_discussion_params(attributes)\n        discussion_attributes = attributes.delete(:discussions_to_resolve)\n        return attributes if discussion_attributes.blank?\n\n        noteable = discussion_attributes[:noteable_id].find\n        unless noteable.is_a?(::MergeRequest)\n          raise Gitlab::Graphql::Errors::ArgumentError,\n            _('Only Merge Requests are allowed as a noteable to resolve discussions of at the moment.')\n        end\n","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/gitlabhq/gitlabhq/blob/55ee20384a1f55cb0e362dee1d07149613b1b9bf/app/graphql/mutations/work_items/create.rb#L131-L167","documentation":"Thrown by `WorkItems::Create#check_feature_available!` when the container is a `Group` and `params[:merge_request_to_resolve_discussions_object]` is set — i.e. the caller passed `discussionsToResolve` while targeting `namespacePath` (a group). Resolving merge request discussions by creating an item is only implemented at project level, so the mutation rejects the combination before checking allowed work item types.","triggerScenarios":"Calling `workItemCreate(namespacePath: \"group\", discussionsToResolve: { noteableId: \"gid://gitlab/MergeRequest/1\", discussionId: \"...\" }, ...)`.","commonSituations":"A 'create issue from discussion' action executed while the user's context/selector is a group instead of the MR's project; generic create forms that always send `namespacePath` and treat `discussionsToResolve` as optional.","solutions":["Send `projectPath` of the merge request's project instead of `namespacePath` when resolving discussions.","Derive the container from the noteable's project when `discussionsToResolve` is present.","Hide the resolve-discussion affordance in group-level create forms."],"exampleFix":"# before\nworkItemCreate(namespacePath: \"group-x\", discussionsToResolve: { noteableId: mr_gid, discussionId: d })\n# after\nworkItemCreate(projectPath: mr.project.full_path, discussionsToResolve: { noteableId: mr_gid, discussionId: d })","handlingStrategy":"validation","validationCode":"if input[:discussions_to_resolve]\n  raise ArgumentError, 'use projectPath' unless container.is_a?(Project)\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive the container from the noteable's project when resolving discussions.","Hide 'create item from discussion' actions in group-level contexts.","Integration-test the discussion-resolution flow against both containers."],"tags":["graphql","work-items","discussions","group-vs-project","gitlab"],"backgroundTag":"container-type-not-supported","analyzedSha":"55ee20384a1f55cb0e362dee1d07149613b1b9bf","analyzedAt":"2026-08-21T14:22:27.782Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}