如何使用Version One rest API查询多种资产类型?

时间:2016-07-28 21:02:06

标签: api rest versionone

我想通过所有者查询任务来获取故事名称和编号。我想知道在单个查询中是否可行,或者我是否必须首先查询特定任务,然后在两个单独的查询中使用任务标识符查找故事。

输入:Task.Owners.Name

输出:Story.Name,Story.Number

任务属性

*Owners.Name

*TaskID

故事属性

*TaskID

*Name

*Number

我可以像下面这样调用REST api:

其余-1.v1 /数据/任务,其中= Task.Owners.Name = '{{OWNERNAME}}' &安培; SEL = Task.Owners.Name,Task.Number,父

有没有办法只使用where条件中指定的任务属性来查询Story端点?

1 个答案:

答案 0 :(得分:1)

  

有没有办法只使用任务属性查询Story端点   在where条件中指定?

我从Story端点开始,通过属于当前Story的任务迭代所有Stories过滤,并按Task的所有者属性进行过滤。

<Grid Grid.Row="1">
                <GroupBox Header="Current Units (English)" HorizontalAlignment="Stretch" Name="currentUnitsGroupBox" VerticalAlignment="Stretch" FontSize="12" FontWeight="Bold">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="6" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="4" />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width=".22*" />
                                <ColumnDefinition Width=".22*" />
                                <ColumnDefinition Width=".22*" />
                                <ColumnDefinition Width=".36*" />
                            </Grid.ColumnDefinitions>
                            <RadioButton 
                                Content="System" 
                                HorizontalAlignment="Stretch" 
                                Name="systemRadio" 
                                VerticalAlignment="Center" 
                                FontSize="12" 
                                FontWeight="Bold" 
                                IsChecked="True" 
                                Grid.Column ="0" 

                                AutomationProperties.AutomationId="CurrentUnitsSystem"/>
                            <RadioButton 
                                Content="English" 
                                FontSize="12" 
                                FontWeight="Bold" 
                                HorizontalAlignment="Stretch" 
                                Name="englishRadio" 
                                VerticalAlignment="Center" 
                                Grid.Column="1" 

                                AutomationProperties.AutomationId="CurrentUnitsEnglish"/>
                            <RadioButton 
                                Content="Metric" 
                                FontSize="12" 
                                FontWeight="Bold" 
                                HorizontalAlignment="Stretch" 
                                Name="metricRadio" 
                                VerticalAlignment="Center" 
                                Grid.Column="2" 

                                AutomationProperties.AutomationId="CurrentUnitsMetric"/>
                        </Grid>
                    </Grid>
                </GroupBox>
            </Grid>

(1)sel = Children:Task [Owners.Name =&#39; pinky&#39;] - Children多关系返回Story的所有子项,即Tests和Tasks。我使用向下转换过滤到只有任务。

(2)在[]内部,您可以在子项:任务中为数据返回添加特定过滤器。

(3)@ where = Children:Task [Owners.Name =&#39; pinky&#39;]是一种过滤掉具有空元素的项目的方法。通过删除它并查看输出的差异来试验它。

相关问题