当前位置: 首页 > news >正文

jira搜索search issue条目rest实用脚本

官方文档链接地址:

The Jira Cloud platform REST API

实用json请求脚本如下:

{"fields": ["summary","status"],"jql": "project = abc AND summary ~ '【%s】【coverity】' AND component=Coverity","maxResults": 1000,"startAt": 0
}

jql字段就是表达式,类似于sql语句里的where条件设定语句,多个条件用“AND”连接

代码示例如下:

public static void searchIssueXTKFDT() throws UnirestException {JsonNodeFactory jnf = JsonNodeFactory.instance;ObjectNode payload = jnf.objectNode();{ArrayNode fields = payload.putArray("fields");fields.add("summary");fields.add("status");//fields.add("assignee");payload.put("jql", "project = TEST");payload.put("maxResults", 100);payload.put("startAt", 0);}// Connect Jackson ObjectMapper to UnirestUnirest.setObjectMapper(new ObjectMapper() {private com.fasterxml.jackson.databind.ObjectMapper jacksonObjectMapper= new com.fasterxml.jackson.databind.ObjectMapper();public <T> T readValue(String value, Class<T> valueType) {try {return jacksonObjectMapper.readValue(value, valueType);} catch (IOException e) {throw new RuntimeException(e);}}public String writeValue(Object value) {println("writeValue=====" + value);try {return jacksonObjectMapper.writeValueAsString(value);} catch (JsonProcessingException e) {throw new RuntimeException(e);}}});//"https://your-domain.atlassian.net/rest/api/2/search"HttpResponse<JsonNode> response = Unirest.post("https://devops-jira.example.com/rest/api/2/search").basicAuth("USER", "TOKEN").header("Accept", "application/json").header("Content-Type", "application/json").body(payload).asJson();JsonNode body = response.getBody();JSONObject json = body.getObject();JSONArray array = json.getJSONArray("issues");int length = array.length();System.out.println("length = " + length);ArrayList<String> status = new ArrayList<>();for (int i = 0; i < length; i ++){JSONObject object = array.getJSONObject(i);String key = object.getString("key");String id = object.getJSONObject("fields").getJSONObject("status").getString("id");status.add(key + "=" + id);}System.out.println("status = " + status);System.out.println(body);}

返回结果如下:

{"expand": "schema,names","total": 8,"maxResults": 100,"issues": [{"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields","self": "https://devops-jira.example.com/rest/api/2/issue/867674","id": "867674","fields": {"summary": "a test of the crash Main order flow broken","status": {"name": "等待验证","self": "https://devops-jira.example.com/rest/api/2/status/11601","description": "","iconUrl": "https://devops-jira.example.com/images/icons/statuses/generic.png","id": "11601","statusCategory": {"colorName": "yellow","name": "In Progress","self": "https://devops-jira.example.com/rest/api/2/statuscategory/4","id": 4,"key": "indeterminate"}}},"key": "TEST-10"},{"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields","self": "https://devops-jira.example.com/rest/api/2/issue/861855","id": "861855","fields": {"summary": "fawtwa4twa这是一个测试","status": {"name": "取消","self": "https://devops-jira.example.com/rest/api/2/status/10124","description": "","iconUrl": "https://devops-jira.example.com/images/icons/statuses/generic.png","id": "10124","statusCategory": {"colorName": "green","name": "Done","self": "https://devops-jira.example.com/rest/api/2/statuscategory/3","id": 3,"key": "done"}}},"key": "TEST-9"},{"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields","self": "https://devops-jira.example.com/rest/api/2/issue/861924","id": "861924","fields": {"summary": "a test of the crash Main order flow broken","status": {"name": "激活","self": "https://devops-jira.example.com/rest/api/2/status/10354","description": "新发现的缺陷","iconUrl": "https://devops-jira.example.com/images/icons/statuses/generic.png","id": "10354","statusCategory": {"colorName": "blue-gray","name": "To Do","self": "https://devops-jira.example.com/rest/api/2/statuscategory/2","id": 2,"key": "new"}}},"key": "TEST-8"},{"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields","self": "https://devops-jira.example.com/rest/api/2/issue/861835","id": "861835","fields": {"summary": "wewrwr","status": {"name": "重新打开","self": "https://devops-jira.example.com/rest/api/2/status/10359","description": "问题未彻底修复","iconUrl": "https://devops-jira.example.com/images/icons/statuses/generic.png","id": "10359","statusCategory": {"colorName": "yellow","name": "In Progress","self": "https://devops-jira.example.com/rest/api/2/statuscategory/4","id": 4,"key": "indeterminate"}}},"key": "TEST-7"},{"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields","self": "https://devops-jira.example.com/rest/api/2/issue/861664","id": "861664","fields": {"summary": "a test of the crash Main order flow broken","status": {"name": "需求规划","self": "https://devops-jira.example.com/rest/api/2/status/10500","description": "","iconUrl": "https://devops-jira.example.com/images/icons/statuses/generic.png","id": "10500","statusCategory": {"colorName": "blue-gray","name": "To Do","self": "https://devops-jira.example.com/rest/api/2/statuscategory/2","id": 2,"key": "new"}}},"key": "TEST-6"},{"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields","self": "https://devops-jira.example.com/rest/api/2/issue/861719","id": "861719","fields": {"summary": "a test of the crash Main order flow broken","status": {"name": "需求规划","self": "https://devops-jira.example.com/rest/api/2/status/10500","description": "","iconUrl": "https://devops-jira.example.com/images/icons/statuses/generic.png","id": "10500","statusCategory": {"colorName": "blue-gray","name": "To Do","self": "https://devops-jira.example.com/rest/api/2/statuscategory/2","id": 2,"key": "new"}}},"key": "TEST-5"},{"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields","self": "https://devops-jira.example.com/rest/api/2/issue/861243","id": "861243","fields": {"summary": "这是一个测试","status": {"name": "需求规划","self": "https://devops-jira.example.com/rest/api/2/status/10500","description": "","iconUrl": "https://devops-jira.example.com/images/icons/statuses/generic.png","id": "10500","statusCategory": {"colorName": "blue-gray","name": "To Do","self": "https://devops-jira.example.com/rest/api/2/statuscategory/2","id": 2,"key": "new"}}},"key": "TEST-2"},{"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields","self": "https://devops-jira.example.com/rest/api/2/issue/860777","id": "860777","fields": {"summary": "testtesttest","status": {"name": "开发处理中","self": "https://devops-jira.example.com/rest/api/2/status/10355","description": "","iconUrl": "https://devops-jira.example.com/images/icons/statuses/generic.png","id": "10355","statusCategory": {"colorName": "yellow","name": "In Progress","self": "https://devops-jira.example.com/rest/api/2/statuscategory/4","id": 4,"key": "indeterminate"}}},"key": "TEST-1"}],"startAt": 0
}

在此做个笔记

相关文章:

jira搜索search issue条目rest实用脚本

官方文档链接地址&#xff1a; The Jira Cloud platform REST API 实用json请求脚本如下&#xff1a; {"fields": ["summary","status"],"jql": "project abc AND summary ~ 【%s】【coverity】 AND componentCoverity"…...

《C++ primer plus》精炼(OOP部分)——对象和类(5)

“学习是照亮心灵的火炬&#xff0c;它永不熄灭&#xff0c;永不止息。” 文章目录 类的自动和强制类型转换原始类型转换为自定义类型将自定义类型转换为原始类型 类的自动和强制类型转换 原始类型转换为自定义类型 可以用一个参数的构造函数来实现&#xff0c;例如&#xff…...

钉钉旧版服务端SDK支持异步方法的升级改造

最近项目中需要对接钉钉&#xff0c;有些钉钉 API 的访问需要使用旧版服务端 SDK 才能搞定&#xff0c;但是这个 SDK 使用的还是 .NET Framework 2.0 框架&#xff0c;不能跨平台部署&#xff0c;也不支持 async\await 的异步操作方法&#xff0c;Nuget 上也有其它用户改造的 .…...

【C语言】【数据存储】用%d打印char类型数据,猜结果是啥

题目代码如下&#xff1a; #include <stdio.h> int main() {char a -1;signed char b-1;unsigned char c-1;printf("a%d,b%d,c%d",a,b,c);return 0; }解题关键&#xff1a; 1.二进制存储&#xff1a;原码&#xff0c;反码&#xff0c;补码 互换 2.截断 3.整型…...

算法——双指针

1658. 将 x 减到 0 的最小操作数 - 力扣&#xff08;LeetCode&#xff09; 这道题的重点是&#xff0c;如何用最小的操作数&#xff0c;来使其x变为0——也可以看作是用最少的数据个数&#xff0c;来求和得到x。 ——但是我们可以知道&#xff0c;由于数据是从两端向中间取的…...

【PowerQuery】Excel的PowerQuery按需刷新

将数据通过PowerQuery 导入进来后,这里将进行数据分组运算,最终的数据计算结果将保存在Excel 表格中,图为销售统计结果。 在Excel中,如果我们希望进行销售统计的手动更新可以使用几种不同的方法来进行刷新: 刷新单一数据连接如果仅仅需要刷新单一数据连接的话我们可以通过…...

Django REST Farmowork初探

1.简介 Django REST framework &#xff08;简称&#xff1a;DRF&#xff09;是一个强大而灵活的 Web API 工具。 遵循RESTFullAPI风格&#xff0c;功能完善&#xff0c;可快速开发API平台。 官网文档&#xff1a;https://www.django-rest-framework.org 2. framwork的安装 …...

【flink进阶】-- Flink kubernetes operator 版本升级

目录 1、检查当前 flink kubernetes operator 版本 2、停止生产上正在运行的 flink job 3、升级 CRD...

Linux Ubuntu20.04深度学习环境快速配置命令记录

一、驱动安装 1、更新系统包 sudo apt-get updatesudo apt-get upgrade 2、安装显卡驱动 使用apt方式安装驱动&#xff0c;多数情况不容易成功&#xff0c; 使用一下方法更佳&#xff1a; 1.查看合适显卡的驱动版本 ubuntu-drivers devices NVIDIA GeForce 驱动程序 - …...

信息安全三级真题一

目录 一、单选题 二、填空题 三、综合题 一、单选题 二、填空题 三、综合题 知法懂法&#xff0c;请各位网络安全从业者遵守《网络安全法》、《个人信息保护法》 业%$务*$&联&#系 XHU3ZjUxXHU3ZWRjXHU4ZmQwXHU3ZWY0XHU2ZTE3XHU5MDBmXHU1NmUyXHU5NjFmXHUyMDBiXHU2M…...

RK3568-tftp更新设备树和内核nfs挂载文件系统

1. 注意:需要设备树和内核按以下修改才能支持tftp和nfs。 1.1 修改设备树: diff --git a/arch/arm64/boot/dts/rockchip/OK3568-C-linux.dts b/arch/arm64/boot/dts/rockchip/OK3568-C-linux.dts index 178b4d831..34cb57ffd 100644 --- a/arch/arm64/boot/dts/rockchip/OK…...

FIR滤波器简述及FPGA仿真验证

数字滤波器的设计&#xff0c;本项目做的数字滤波器准确来说是FIR滤波器。 FIR滤波器&#xff08;有限冲激响应滤波器&#xff09;&#xff0c;与另一种基本类型的数字滤波器——IIR滤波器&#xff08;无限冲击响应滤波器&#xff09;相对应&#xff0c;其实就是将所输入的信号…...

高速信号处理板资料保存:383-基于kintex UltraScale XCKU060的双路QSFP+光纤PCIe 卡设计原理图

基于kintex UltraScale XCKU060的双路QSFP光纤PCIe 卡 一、板卡概述 本板卡系我司自主研发&#xff0c;基于Xilinx UltraScale Kintex系列FPGA XCKU060-FFVA1156-2-I架构&#xff0c;支持PCIE Gen3 x8模式的高速信号处理板卡&#xff0c;搭配两路40G QSFP接口&#xf…...

QT:使用分组框、单选按钮、普通按钮、标签、行编辑器、垂直分布、水平分布做一个小项目

widget.h #ifndef WIDGET_H #define WIDGET_H#include <QWidget> #include <QRadioButton> //单选按钮 #include <QGroupBox> //分组框 #include <QHBoxLayout> //水平布局 #include <QVBoxLayout> //垂直布局 #include <QPushButton>…...

封装微信小程序隐私信息授权

隐私 代码 html &#xff08;modal 组件再后面封装有提供&#xff09; <modal isShow"{{show}}"><view class"privacy-auth-dialog"><view class"title">温馨提示</view><view class"content"><vi…...

【C#】FileInfo类 对文件进行操作

提示&#xff1a;使用FileInfo类时&#xff0c;要引用System.IO命名空间。 using System.IO; FileInfo类 生成文件删除文件移动文件复制文件获取文件名判断文件是否存在属性列表其它常用方法 生成文件 Create()&#xff1a;在指定路径上创建文件。 FileInfo myFile new FileIn…...

python中的字符串也是可迭代对象吗?

python中的字符串也是可迭代对象吗&#xff1f; ━━━━━━━━━━━━━━━━━━━━━━   是的&#xff0c;Python中的字符串是可迭代对象。这意味着你可以像处理列表或元组那样处理字符串。例如&#xff0c;你可以使用for循环遍历字符串中的每个字符&#xff0c;或…...

C++ 图像线特征提取【HoughLinesP算法】

目录 一、函数介绍二、实现步骤三、代码示例一、函数介绍 HoughLinesP:是一种基于Hough变换的直线检测算法。它可以识别图像中的直线,并返回它们的端点坐标。其函数接口如下: cv::HoughLinesP(   InputArray src,   // 输入图像,必须 8-bit 的灰度图像   OutputArray…...

Stable Diffusion WebUI内存不够爆CUDA Out of memory怎么办?

在我们运行SD的时候,我们经常会爆CUDA Out of memory。 我们应该怎么办呢? 这是因为我们的显存或者内存不够了。 如果你是用cpu来跑图的则表示内存不够,这个时候就需要换个大点的内存了。 如果你是用gpu来跑图的就说明你显存不够用咯,这时候咋办呢? 下面我将一一述说…...

模板学堂|数据可视化仪表板大屏设计流程梳理

DataEase开源数据可视化分析平台于2022年6月正式发布模板市场&#xff08;https&#xff1a;//dataease.io/templates/&#xff09;。模板市场旨在为DataEase用户提供专业、美观、拿来即用的仪表板模板&#xff0c;方便用户根据自身的业务需求和使用场景选择对应的仪表板模板&a…...

XML Group端口详解

在XML数据映射过程中&#xff0c;经常需要对数据进行分组聚合操作。例如&#xff0c;当处理包含多个物料明细的XML文件时&#xff0c;可能需要将相同物料号的明细归为一组&#xff0c;或对相同物料号的数量进行求和计算。传统实现方式通常需要编写脚本代码&#xff0c;增加了开…...

鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个医院挂号小程序

一、开发准备 ​​环境搭建​​&#xff1a; 安装DevEco Studio 3.0或更高版本配置HarmonyOS SDK申请开发者账号 ​​项目创建​​&#xff1a; File > New > Create Project > Application (选择"Empty Ability") 二、核心功能实现 1. 医院科室展示 /…...

Psychopy音频的使用

Psychopy音频的使用 本文主要解决以下问题&#xff1a; 指定音频引擎与设备&#xff1b;播放音频文件 本文所使用的环境&#xff1a; Python3.10 numpy2.2.6 psychopy2025.1.1 psychtoolbox3.0.19.14 一、音频配置 Psychopy文档链接为Sound - for audio playback — Psy…...

是否存在路径(FIFOBB算法)

题目描述 一个具有 n 个顶点e条边的无向图&#xff0c;该图顶点的编号依次为0到n-1且不存在顶点与自身相连的边。请使用FIFOBB算法编写程序&#xff0c;确定是否存在从顶点 source到顶点 destination的路径。 输入 第一行两个整数&#xff0c;分别表示n 和 e 的值&#xff08;1…...

比较数据迁移后MySQL数据库和OceanBase数据仓库中的表

设计一个MySQL数据库和OceanBase数据仓库的表数据比较的详细程序流程,两张表是相同的结构,都有整型主键id字段,需要每次从数据库分批取得2000条数据,用于比较,比较操作的同时可以再取2000条数据,等上一次比较完成之后,开始比较,直到比较完所有的数据。比较操作需要比较…...

Kafka主题运维全指南:从基础配置到故障处理

#作者&#xff1a;张桐瑞 文章目录 主题日常管理1. 修改主题分区。2. 修改主题级别参数。3. 变更副本数。4. 修改主题限速。5.主题分区迁移。6. 常见主题错误处理常见错误1&#xff1a;主题删除失败。常见错误2&#xff1a;__consumer_offsets占用太多的磁盘。 主题日常管理 …...

sshd代码修改banner

sshd服务连接之后会收到字符串&#xff1a; SSH-2.0-OpenSSH_9.5 容易被hacker识别此服务为sshd服务。 是否可以通过修改此banner达到让人无法识别此服务的目的呢&#xff1f; 不能。因为这是写的SSH的协议中的。 也就是协议规定了banner必须这么写。 SSH- 开头&#xff0c…...

智能体革命:企业如何构建自主决策的AI代理?

OpenAI智能代理构建实用指南详解 随着大型语言模型&#xff08;LLM&#xff09;在推理、多模态理解和工具调用能力上的进步&#xff0c;智能代理&#xff08;Agents&#xff09;成为自动化领域的新突破。与传统软件仅帮助用户自动化流程不同&#xff0c;智能代理能够自主执行工…...

华为OD机考- 简单的自动曝光/平均像素

import java.util.Arrays; import java.util.Scanner;public class DemoTest4 {public static void main(String[] args) {Scanner in new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextLine()) { // 注意 while 处理多个 caseint[] arr Array…...

旋量理论:刚体运动的几何描述与机器人应用

旋量理论为描述刚体在三维空间中的运动提供了强大而优雅的数学框架。与传统的欧拉角或方向余弦矩阵相比&#xff0c;旋量理论通过螺旋运动的概念统一了旋转和平移&#xff0c;在机器人学、计算机图形学和多体动力学领域具有显著优势。这种描述不仅几何直观&#xff0c;而且计算…...