public Version CreateVersion(string versionName, string projectKey)
        {
            try
            {
                var version = _jiraCloudApi.GetVersion(versionName);
                if (version == null)
                {
                    var versionCreation = new VersionCreation
                    {
                        description = "Created from Automation Framework",
                        archived    = false,
                        name        = versionName,
                        project     = projectKey,
                        projectId   = ProjectId,
                        startDate   = DateTime.Today.ToString("yyyy-MM-dd")
                    };
                    version = _jiraCloudApi.CreateVersion(versionCreation);
                }

                return(version);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Create version {versionName} failed at: {e.Message}");
                return(null);
            }
        }
Пример #2
0
        public Version CreateVersion(VersionCreation versionCreation)
        {
            var source   = $"{JiraSource}/version";
            var response = SendHttpRequest(source, Method.POST, versionCreation);

            if (response == null)
            {
                return(null);
            }
            return(new Version
            {
                Id = (long)response[Id],
                Name = (string)response[Name],
                ProjectId = (long)response[ProjectId]
            });
        }