当前位置: 首页 > 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…...

Linux链表操作全解析

Linux C语言链表深度解析与实战技巧 一、链表基础概念与内核链表优势1.1 为什么使用链表&#xff1f;1.2 Linux 内核链表与用户态链表的区别 二、内核链表结构与宏解析常用宏/函数 三、内核链表的优点四、用户态链表示例五、双向循环链表在内核中的实现优势5.1 插入效率5.2 安全…...

【JavaEE】-- HTTP

1. HTTP是什么&#xff1f; HTTP&#xff08;全称为"超文本传输协议"&#xff09;是一种应用非常广泛的应用层协议&#xff0c;HTTP是基于TCP协议的一种应用层协议。 应用层协议&#xff1a;是计算机网络协议栈中最高层的协议&#xff0c;它定义了运行在不同主机上…...

阿里云ACP云计算备考笔记 (5)——弹性伸缩

目录 第一章 概述 第二章 弹性伸缩简介 1、弹性伸缩 2、垂直伸缩 3、优势 4、应用场景 ① 无规律的业务量波动 ② 有规律的业务量波动 ③ 无明显业务量波动 ④ 混合型业务 ⑤ 消息通知 ⑥ 生命周期挂钩 ⑦ 自定义方式 ⑧ 滚的升级 5、使用限制 第三章 主要定义 …...

MFC内存泄露

1、泄露代码示例 void X::SetApplicationBtn() {CMFCRibbonApplicationButton* pBtn GetApplicationButton();// 获取 Ribbon Bar 指针// 创建自定义按钮CCustomRibbonAppButton* pCustomButton new CCustomRibbonAppButton();pCustomButton->SetImage(IDB_BITMAP_Jdp26)…...

【算法训练营Day07】字符串part1

文章目录 反转字符串反转字符串II替换数字 反转字符串 题目链接&#xff1a;344. 反转字符串 双指针法&#xff0c;两个指针的元素直接调转即可 class Solution {public void reverseString(char[] s) {int head 0;int end s.length - 1;while(head < end) {char temp …...

ElasticSearch搜索引擎之倒排索引及其底层算法

文章目录 一、搜索引擎1、什么是搜索引擎?2、搜索引擎的分类3、常用的搜索引擎4、搜索引擎的特点二、倒排索引1、简介2、为什么倒排索引不用B+树1.创建时间长,文件大。2.其次,树深,IO次数可怕。3.索引可能会失效。4.精准度差。三. 倒排索引四、算法1、Term Index的算法2、 …...

vue3+vite项目中使用.env文件环境变量方法

vue3vite项目中使用.env文件环境变量方法 .env文件作用命名规则常用的配置项示例使用方法注意事项在vite.config.js文件中读取环境变量方法 .env文件作用 .env 文件用于定义环境变量&#xff0c;这些变量可以在项目中通过 import.meta.env 进行访问。Vite 会自动加载这些环境变…...

Rapidio门铃消息FIFO溢出机制

关于RapidIO门铃消息FIFO的溢出机制及其与中断抖动的关系&#xff0c;以下是深入解析&#xff1a; 门铃FIFO溢出的本质 在RapidIO系统中&#xff0c;门铃消息FIFO是硬件控制器内部的缓冲区&#xff0c;用于临时存储接收到的门铃消息&#xff08;Doorbell Message&#xff09;。…...

虚拟电厂发展三大趋势:市场化、技术主导、车网互联

市场化&#xff1a;从政策驱动到多元盈利 政策全面赋能 2025年4月&#xff0c;国家发改委、能源局发布《关于加快推进虚拟电厂发展的指导意见》&#xff0c;首次明确虚拟电厂为“独立市场主体”&#xff0c;提出硬性目标&#xff1a;2027年全国调节能力≥2000万千瓦&#xff0…...

计算机基础知识解析:从应用到架构的全面拆解

目录 前言 1、 计算机的应用领域&#xff1a;无处不在的数字助手 2、 计算机的进化史&#xff1a;从算盘到量子计算 3、计算机的分类&#xff1a;不止 “台式机和笔记本” 4、计算机的组件&#xff1a;硬件与软件的协同 4.1 硬件&#xff1a;五大核心部件 4.2 软件&#…...