我对JIRA的REST API很陌生,我希望得到用户在问题上花费的总时间.我尝试使用https://jira.domain.com/rest/api/2/search?jql=assignee="my.name",并timespent在返回的JSON响应中获取字段,但它显示的值没有任何意义.在这种情况下,timespent字段显示为62760,当我在该问题上花费的实际时间少于该时间时,搜索将返回在该问题上花费的总时间,而不仅仅是我.我怎样才能让它显示我的时间?
编辑:有没有办法用JQL做到这一点,而不必为每个问题做另一个API调用?
我有一个名为“ Status ”的自定义字段,ID 为 10100,它是一个选择列表,可选值为“ One ”、“ Two ”、“ Three ”和“ Four ”。默认值为“一”。
我正在编写一个 JIRA python 脚本来有条件地更新该字段的值。假设现有值为“一”,则应将其更改为“二”。
这是我的代码。
from jira.client import JIRA
jira_options={'server': 'http://localhost:8080'}
jira=JIRA(options=jira_options,basic_auth=('usrname','pwd'))
for issue in jira.search_issues(' cf[10100] = "One" '):
issue.update(fields={'customfield_10100': 'Two'})
Run Code Online (Sandbox Code Playgroud)
它给了我以下错误。
Traceback (most recent call last):
File "test.py", line 11, in <module>
issue.update(fields={'customfield_10100': 'Two'})
File "C:\Python27\lib\site-packages\jira\resources.py", line 193, in update
super(Issue, self).update(**data)
File "C:\Python27\lib\site-packages\jira\resources.py", line 72, in update
raise_on_error(r)
File "C:\Python27\lib\site-packages\jira\exceptions.py", line 29, in raise_on_
error
error …Run Code Online (Sandbox Code Playgroud) 我可以使用CURL命令在JIRA中创建票证,并且可以方便地使用json数据。
curl -D- -u:-X POST --data @ <文件名> -H“内容类型:application / json” http:// <主机名>:<端口> / rest / api / 2 / issue /
我现在正尝试更新所生成票证的状态,但出现以下错误。
{"errorMessages":[],"errors":{"status":"Field 'status' cannot be set. It is not on the appropriate screen, or unknown."}}
卷曲命令:
curl -D- -u <用户>:<pwd> -X PUT --data @ data_update.txt -H“内容类型:application / json” http:// <主机名>:8100 / rest / api / 2 /问题/ MTF-3
我正在尝试使用解决日期运行查询,并根据解决日期检索具有实际状态的结果列表。
今天运行此查询时,我收到一个包含已解决错误的列表,同时我想知道它们在这段时间是否处于打开状态。
就我而言,我想使用 REST API 请求查询,如果错误在 2017 年 1 月 1 日“开放”,我希望在响应中获取它,即使它现在已关闭。
谢谢!
更新: 解决日期显示日期之间问题的当前状态,但不显示查询本身中提到的日期的状态。
resolutiondate > "2017/01/01" and resolutiondate < "2017/02/01"
Run Code Online (Sandbox Code Playgroud) 遵循JIRA REST API 的doco,OAuth和HTTP Basic是两种推荐的身份验证.我们正在使用带有https的HTTP Basic,它运行良好且安全.
他们之间的表现有什么不同吗?
输入网址,或使用curl运行,如:
https://<myurl>/rest/api/2/search?jql=project=<myproject>&status=closed&fields=id,key,status,project&maxResults=5
Run Code Online (Sandbox Code Playgroud)
在我的项目中返回5项但具有所有状态.出于某种原因,我无法查询特定状态.
输出(部分)是:
{
"expand": "schema,names",
"startAt": 0,
"maxResults": 5,
"total": 727,
"issues": [
{
"expand": "editmeta,renderedFields,transitions,changelog,operations",
"id": "79577",
"self": "https://<myurl>/rest/api/2/issue/79577",
"key": "<myproject>-774",
"fields": {
"project": {
"self": "https://<myurl>/rest/api/2/project/<myproject>",
"id": "14421",
"key": "<myproject>",
"name": "<myproject>",
"avatarUrls": {
(...)
}
},
"status": {
"self": "<myurl>/rest/api/2/status/1",
"description": "The issue is open and ready for the assignee to start work on it.",
"iconUrl": "https://<myurl>/images/icons/statuses/open.png",
"name": "Open",
"id": "1"
}
}
},(...)
]
}
Run Code Online (Sandbox Code Playgroud)
如何查询给定状态?非常感谢.
这是我的用例.
1.我有一个"客户名称"文本字段和"所有客户"单选列表.
2.问题解决后,我想选择"客户名称"中的值,并希望添加"所有客户".
我能够实现这一目标如果要添加的值已经存在于"所有客户"中.但是我希望在"所有客户"字段中填入新值(如果它尚未出现),以便将来可供选择.这该怎么做?有可能这样做吗?
我需要更新“事项”字段(单选列表)。最好的方法是什么?
我有一个批量值(超过 100 个)要添加到自定义字段中。有什么方法可以通过使用 API 来做到这一点吗?我也检查了链接
但这里也没有提及任何内容。
今天我将命令行应用程序更新到 Spring Boot 3.0.6
BeanCreationException我在启动应用程序时收到异常。原因是
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.core.UriBuilder
Run Code Online (Sandbox Code Playgroud)
这是 内部需要的com.atlassian.jira.rest.client.api.JiraRestClient。在IDEA中,当我搜索时,javax.ws.rs.core.UriBuilder我没有找到任何课程。
所以我包括了
implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1'
Run Code Online (Sandbox Code Playgroud)
在我的 Gradle 构建中。现在我收到一个
Caused by: java.lang.LinkageError: ClassCastException: attempting to cast
jar:file:/XXX/.gradle/caches/modules-2/files-2.1/javax.ws.rs/javax.ws.rs-api/2.1.1/d3466bc9321fe84f268a1adb3b90373fc14b0eb5/javax.ws.rs-api-2.1.1.jar!/javax/ws/rs/ext/RuntimeDelegate.class to
jar:file:/XXX/.gradle/caches/modules-2/files-2.1/javax.ws.rs/javax.ws.rs-api/2.1.1/d3466bc9321fe84f268a1adb3b90373fc14b0eb5/javax.ws.rs-api-2.1.1.jar!/javax/ws/rs/ext/RuntimeDelegate.class
Run Code Online (Sandbox Code Playgroud)
两行/文件都是相同的。
到目前为止我尝试过的事情:
javax.ws.rs检查with的不同版本gradlew dependencies有谁知道如何解决这个问题以及为什么 UriBuilder 根本消失了?
项目主要依赖
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
<version>1.1.2.RELEASE</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>com.rallydev.rest</groupId>
<artifactId>rally-rest-api</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.2</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.7</version>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
JIRA REST API 依赖项
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9</version>
</dependency>
<dependency> …Run Code Online (Sandbox Code Playgroud) jira ×8
jql ×2
curl ×1
gradle ×1
java ×1
jira-plugin ×1
kotlin ×1
python ×1
rest ×1
spring-boot ×1