create_issue

in lib/retrospective.rb [14:41]


  def create_issue(team:, release:, dry_run:)
    issue_url = nil
    template = DescriptionTemplate.new(team, release, api_client: read_client)
    result = template.result_with_hash(updating_description: false)

    log_info('Issue', result, dry_run: dry_run)

    unless dry_run
      created_issue = write_client.post(
        "projects/gl-retrospectives%2F#{team.project}/issues",
        body: {
          title: "#{release['title']} #{team.name} retrospective",
          description: result,
          confidential: team.confidential?
        }
      )

      issue_url = created_issue['_links']['self']

      puts "Created with URL #{created_issue['web_url']}"
      puts ''
    end

    mention_team(template.current_api_path, team: team, dry_run: dry_run) if team.mention_team_on_creation

    create_discussions(issue_url, team: team, dry_run: dry_run)
  end