我在RestTemplate中是全新的,基本上也在REST API中.我想通过Jira REST API在我的应用程序中检索一些数据,但是要取回401 Unauthorized.找到并发表关于jira rest api文档的文章,但实际上并不知道如何将其重写为java,因为该示例使用curl命令行方式.我将不胜感激任何建议或建议如何重写:
curl -D- -X GET -H "Authorization: Basic ZnJlZDpmcmVk" -H "Content-Type: application/json" "http://kelpie9:8081/rest/api/2/issue/QA-31"
Run Code Online (Sandbox Code Playgroud)
使用spring rest模板进入java.其中ZnJlZDpmcmVk是base64编码的username:password字符串.非常感谢你.
任何人都可以指定将JIRA与TortoiseSVN集成以跟踪问题详情的方法吗?应在URL部分指定什么URL,需要的其他参数是什么?你有什么需要在JIRA方面做的,以确保整合?
如何为JIRA Rest API创建访问令牌?我有相关数据
Jira的Rest API Oauth 示例采用三方法,并且非常不清楚要发送的实际参数是什么(我希望Swagger是更广泛使用的标准!).
更详细地说,我有以下用例:在Web窗体(ASPX)门户应用程序中创建新员工时,我需要创建新的JIRA帐户并将其分配给项目(以及项目中的角色).
因此,我想使用OAuth2双方式身份验证来实现此目的.我可以用基本身份验证破解它,但我真的想要正确地做到这一点.
尝试查找使用此方法的代码示例时出现问题..NET示例非常稀缺,甚至其他语言的示例通常使用基本身份验证(每次调用时传输的用户名和密码)或少数使用三脚法的示例.
我找到了AnotherJiraRestClient,但是查看它使用RestClient nuget的代码(这很好)但是使用HttpBasicAuthenticator(这很糟糕).
我浏览了所有提供的Authenticators,OAuth2AuthorizationRequestHeaderAuthenticator看起来很有希望,但它要求我已经拥有访问令牌.所以这就是为什么最后的问题是"如何使用两条腿的方法创建访问令牌?"
我已经使用以下设置在JIRA上创建了应用程序链接:
我想用python-jira更改jira问题状态.python-jira API是http://jira-python.readthedocs.org/en/latest/.我找不到任何方法来执行此操作.我试图使用issue.update(status="Closed").但它没有用 .我在https://developer.atlassian.com/display/JIRADEV/Issue+status+and+workflow中找到了问题状态和工作流程.但我还是不知道是什么要做什么.任何人都可以帮助我吗?
是否有类似" http://www.example.com/jira/rest/agile/1.0/sprint?project=XYZ "的内容,以检索项目中的所有冲刺.
JIRA平台api可以检索项目信息,JIRA软件API可以检索给定板的冲刺.但我需要针对给定项目的任何给定项目(组合)或至少板的冲刺,以便我可以在以后检索这些板中的冲刺
我尝试使用 CURL 命令在 keycloak 上创建用户(创建时不提供任何密码),成功,但无法知道登录密码。那么,如何在创建时为用户提供密码。以及如何在keycloak中为新用户设置默认密码
我使用此链接使用 curl创建用户:从 curl 命令在 Keycloack 上创建用户
我正在尝试使用PHP的JIRA REST API.当我复制下面的网址并将其直接粘贴到浏览器中时,它可以正常工作.生成的问题以json的形式返回.
但是使用下面的代码它不起作用.我收到Unauthorized(401)作为回复消息.是的,我已检查并仔细检查凭据是否有效.这是我的代码:
$username = 'username';
$password = 'psw';
$url = "https://mycompany.atlassian.net/rest/api/2/issue/XXX-123";
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
$result = curl_exec($curl);
echo $result;
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我正在使用REST API 6.2.6对JIRA进行集成.我需要做的一件事是为项目获取问题类型方案和工作流程方案.
问题类型方案
我现在唯一可以得到的是使用的问题类型列表/rest/api/2/project/{projectIdOrKey}.我看不到任何获取问题类型方案ID的方法.看看API,问题类型方案没有任何端点,所以我想这是不可能的.
工作流程方案
/rest/api/2/project/{projectIdOrKey}不会返回有关工作流程方案的任何信息.但是有一个端点/rest/api/2/workflowscheme/{id},这意味着可以以某种方式获取ID ...最后,我想得到一个项目工作流列表,以检查问题类型的转换.
有没有办法获得我想要的数据?也许有一些隐藏的未记录的API?
注意:我只使用JIRA REST API.
我有一个场景,我使用离子将我的本地驱动器(键入jpeg或png)上的图像文件上传到API端点.这是我的代码如下:
fileupload.html - >
//---------------------------------------------------
<ion-item>
<ion-input type="file" accept="image/*" (change)="changeListener($event)"> </ion-input>
</ion-item>
Run Code Online (Sandbox Code Playgroud)
fileupload.ts - >
changeListener($event):void{
this.file=$event.target.files[0];
console.log(this.file);
console.log("upload...");
let regData={"file":this.file};
console.log("REGDATAA"+JSON.stringify(regData));
this.jira.postAttachment("PM-3",regData).subscribe(dataa=>{
console.log(dataa);
});
}
Run Code Online (Sandbox Code Playgroud)
provider.ts - >
public postAttachment(key,data):Observable<any>{
console.log(JSON.stringify(data))
return this.http.post(this.api+'/issue/'+key+'/attachments',JSON.stringify(data),{
headers: new HttpHeaders()
.append('Authorization', `Basic ${this.auth.getAuthString()}`)
.append('Content-Type','multipart/form-data';boundary="-------xe3rtyhrfds")
.append("X-Atlassian-Token", "no-check")
.append("User-Agent", "xx")
});
}
Run Code Online (Sandbox Code Playgroud)
每次我发送文件时它都没有采用路径并发送一个空响应,这是下面的错误.
//----------------------------------------------------
[object File]: {lastModifiedDate: [date] Fri Sep 21 2018 17:42:46 GMT+0530 (India Standard Time), name: "download.jpg", size: 5056, type: "image/jpeg", webkitRelativePath: ""}
upload...
ion-dev.js (157,11)
REGDATAA{"file":{}}
ion-dev.js (157,11)
{"file":{}}
ion-dev.js (157,11)
ERROR …Run Code Online (Sandbox Code Playgroud) jira-rest-api ionic-framework ionic-view ionic-native ionic3
我在Confluence用户宏中从JavaScript调用JIRA REST API,我面临CORS问题,因为JIRA和Confluence位于两个不同的域上,浏览器的预检请求失败.我已经尝试了几种CORS解决方案,如下所述,没有任何成功.所以我乞求其他人可能解决了这个问题的一些意见.
失败的JavaScript代码段:
AJS.$.ajax({
type: "GET",
url: "http://jira.mydomain.com/rest/api/latest/search/?jql=issue%20in%20linkedIssues(SR-45)",
dataType: "json",
contentType: "application/json",
async: false
})
Run Code Online (Sandbox Code Playgroud)
错误消息(来自Firefox):
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://jira.mydomain.com/rest/api/latest/search/?jql=issue%20in%20linkedIssues(SR-45). This can be fixed by moving the resource to the same domain or enabling CORS.
Run Code Online (Sandbox Code Playgroud)
JIRA配置
Access-Control-Allow-Headers:origin, content-type, acceptAccess-Control-Allow-Methods:POST, GET, OPTIONSAccess-Control-Allow-Origin:*汇流配置
jira-rest-api ×10
jira ×6
curl ×2
asp.net ×1
c# ×1
cors ×1
ionic-native ×1
ionic-view ×1
ionic3 ×1
java ×1
javascript ×1
jira-agile ×1
keycloak ×1
oauth ×1
php ×1
python ×1
python-jira ×1
resttemplate ×1
spring ×1
svn ×1
tortoisesvn ×1