コード例 #1
0
        public async Task <Epic> UpdateEpic(string epicKey, EpicMeta meta)
        {
            var fieldsNameToKeyMap = await GetFields();

            var content = MapMetaToIssueContent(meta, fieldsNameToKeyMap);
            await _client.UpdateIssue(epicKey, content);

            var epics = await _client.QueryJql($"key={epicKey}");

            return(_mapper.MapEpic(epics.Single(), fieldsNameToKeyMap));
        }
コード例 #2
0
        public void MapEpic_should_map_basic_epic_fields()
        {
            var key            = "ABC-11";
            var id             = "123";
            var summary        = "My epic name";
            var project        = "Project Name";
            var status         = "Todo";
            var statusCategory = "To Do";

            var epicJson = $@"{{
    ""id"": ""{id}"",
    ""key"": ""{key}"",
    ""fields"": {{
        ""project"": {{
            ""name"": ""{project}""
        }},
        ""status"": {{
            ""name"": ""{status}"",
            ""statusCategory"": {{
                ""name"": ""{statusCategory}""
            }}
        }},
        ""summary"": ""{summary}"",
        ""issuelinks"": []
    }}
}}";
            var epic     = _mapper.MapEpic(ToJsonElement(epicJson), new Dictionary <string, string[]>());

            epic.Id.ShouldBe(id);
            epic.Key.ShouldBe(key);
            epic.Summary.ShouldBe(summary);
            epic.Project.ShouldBe(project);
            epic.Status.ShouldBe(status);
            epic.StatusCategory.ShouldBe(statusCategory);
            epic.Url.ShouldBe($"{_config.JiraUri}/browse/{key}");
            epic.StartDate.ShouldBeNull();
            epic.DueDate.ShouldBeNull();
        }