private async Task GetArray_By_Ids()
        {
            // GIVEN 3 custom fields
            var customFieldNoTypeId = (await CreateSampleCustomField()).Id;
            var customFieldBugId    = await CreateSampleCustomField(BacklogItemType.Bug);

            await CreateSampleCustomField(BacklogItemType.UserStory);

            // WHEN querying with no parameters
            var ids  = new [] { customFieldNoTypeId, customFieldBugId };
            var list = await _queryService.GetArray(new CustomFieldListGetRequest { Ids = ids });

            // THEN
            // only 2 custom fields get returned
            Assert.Equal(2, list.Length);
            Assert.Equal(ids, list.Select(l => l.Id).OrderBy(i => i).ToArray());
        }
        /// <inheritdoc/>
        public async Task <IDomainResult <BacklogItemGetResponseBase> > GetById(string id)
        {
            var fullId = GetFullId(id);

            var ticket = await DbSession.LoadAsync <BacklogItem>(fullId);

            if (ticket == null)
            {
                return(DomainResult.NotFound <BacklogItemGetResponseBase>());
            }

            List <BacklogItemCustomFieldValue>?customFieldValues = null;

            if (ticket.CustomFields?.Any() == true)
            {
                customFieldValues = (await _customFieldsService.GetArray(new CustomFieldListGetRequest {
                    Ids = ticket.CustomFields.Keys
                })).ConvertFieldToDto(ticket.CustomFields);
            }

            var dto = ticket.Type switch
            {
                BacklogItemType.Bug => (ticket as BacklogItemBug)?.ConvertToDto <BacklogItemBug, BugGetResponse>                 (customFieldValues)     as BacklogItemGetResponseBase,
                BacklogItemType.UserStory => (ticket as BacklogItemUserStory)?.ConvertToDto <BacklogItemUserStory, UserStoryGetResponse>       (customFieldValues)     as BacklogItemGetResponseBase,
                BacklogItemType.Task => (ticket as BacklogItemTask)?.ConvertToDto <BacklogItemTask, TaskGetResponse>                (customFieldValues)     as BacklogItemGetResponseBase,
                BacklogItemType.Feature => (ticket as BacklogItemFeature)?.ConvertToDto <BacklogItemFeature, FeatureGetResponse>             (customFieldValues)     as BacklogItemGetResponseBase,
                _ => throw new NotImplementedException($"Not supported Backlog Item Type: {ticket.Type}"),
            };

            if (dto == null)
            {
                throw new NotSupportedException($"Failed to return Backlog Item type of {ticket.Type}");
            }

            return(DomainResult.Success(dto));
        }