mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-05 04:28:28 +02:00
update all usage of user.name to user.accountId for privacy migration:
https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/
This commit is contained in:
@@ -3,6 +3,7 @@ package jiracmd
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/coryb/figtree"
|
||||
"github.com/coryb/oreo"
|
||||
@@ -62,6 +63,14 @@ func CmdCreateUsage(cmd *kingpin.CmdClause, opts *CreateOptions) error {
|
||||
// CmdCreate sends the create-metadata to the "create" template for editing, then
|
||||
// will parse the edited document as YAML and submit the document to jira.
|
||||
func CmdCreate(o *oreo.Client, globals *jiracli.GlobalOptions, opts *CreateOptions) error {
|
||||
if globals.JiraDeploymentType.Value == "" {
|
||||
serverInfo, err := jira.ServerInfo(o, globals.Endpoint.Value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
globals.JiraDeploymentType.Value = strings.ToLower(serverInfo.DeploymentType)
|
||||
}
|
||||
|
||||
type templateInput struct {
|
||||
Meta *jiradata.IssueType `yaml:"meta" json:"meta"`
|
||||
Overrides map[string]string `yaml:"overrides" json:"overrides"`
|
||||
@@ -86,6 +95,12 @@ func CmdCreate(o *oreo.Client, globals *jiracli.GlobalOptions, opts *CreateOptio
|
||||
|
||||
var issueResp *jiradata.IssueCreateResponse
|
||||
err = jiracli.EditLoop(&opts.CommonOptions, &input, &issueUpdate, func() error {
|
||||
if globals.JiraDeploymentType.Value == jiracli.CloudDeploymentType {
|
||||
err := fixGDPRUserFields(o, globals.Endpoint.Value, createMeta.Fields, issueUpdate.Fields)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
issueResp, err = jira.CreateIssue(o, globals.Endpoint.Value, &issueUpdate)
|
||||
return err
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user