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

零门槛NAS搭建:WinNAS如何让普通电脑秒变私有云?

一、核心优势&#xff1a;专为Windows用户设计的极简NAS WinNAS由深圳耘想存储科技开发&#xff0c;是一款收费低廉但功能全面的Windows NAS工具&#xff0c;主打“无学习成本部署” 。与其他NAS软件相比&#xff0c;其优势在于&#xff1a; 无需硬件改造&#xff1a;将任意W…...

【Linux】shell脚本忽略错误继续执行

在 shell 脚本中&#xff0c;可以使用 set -e 命令来设置脚本在遇到错误时退出执行。如果你希望脚本忽略错误并继续执行&#xff0c;可以在脚本开头添加 set e 命令来取消该设置。 举例1 #!/bin/bash# 取消 set -e 的设置 set e# 执行命令&#xff0c;并忽略错误 rm somefile…...

Swift 协议扩展精进之路:解决 CoreData 托管实体子类的类型不匹配问题(下)

概述 在 Swift 开发语言中&#xff0c;各位秃头小码农们可以充分利用语法本身所带来的便利去劈荆斩棘。我们还可以恣意利用泛型、协议关联类型和协议扩展来进一步简化和优化我们复杂的代码需求。 不过&#xff0c;在涉及到多个子类派生于基类进行多态模拟的场景下&#xff0c;…...

Keil 中设置 STM32 Flash 和 RAM 地址详解

文章目录 Keil 中设置 STM32 Flash 和 RAM 地址详解一、Flash 和 RAM 配置界面(Target 选项卡)1. IROM1(用于配置 Flash)2. IRAM1(用于配置 RAM)二、链接器设置界面(Linker 选项卡)1. 勾选“Use Memory Layout from Target Dialog”2. 查看链接器参数(如果没有勾选上面…...

【python异步多线程】异步多线程爬虫代码示例

claude生成的python多线程、异步代码示例&#xff0c;模拟20个网页的爬取&#xff0c;每个网页假设要0.5-2秒完成。 代码 Python多线程爬虫教程 核心概念 多线程&#xff1a;允许程序同时执行多个任务&#xff0c;提高IO密集型任务&#xff08;如网络请求&#xff09;的效率…...

【OSG学习笔记】Day 16: 骨骼动画与蒙皮(osgAnimation)

骨骼动画基础 骨骼动画是 3D 计算机图形中常用的技术&#xff0c;它通过以下两个主要组件实现角色动画。 骨骼系统 (Skeleton)&#xff1a;由层级结构的骨头组成&#xff0c;类似于人体骨骼蒙皮 (Mesh Skinning)&#xff1a;将模型网格顶点绑定到骨骼上&#xff0c;使骨骼移动…...

重启Eureka集群中的节点,对已经注册的服务有什么影响

先看答案&#xff0c;如果正确地操作&#xff0c;重启Eureka集群中的节点&#xff0c;对已经注册的服务影响非常小&#xff0c;甚至可以做到无感知。 但如果操作不当&#xff0c;可能会引发短暂的服务发现问题。 下面我们从Eureka的核心工作原理来详细分析这个问题。 Eureka的…...

用机器学习破解新能源领域的“弃风”难题

音乐发烧友深有体会&#xff0c;玩音乐的本质就是玩电网。火电声音偏暖&#xff0c;水电偏冷&#xff0c;风电偏空旷。至于太阳能发的电&#xff0c;则略显朦胧和单薄。 不知你是否有感觉&#xff0c;近两年家里的音响声音越来越冷&#xff0c;听起来越来越单薄&#xff1f; —…...

人机融合智能 | “人智交互”跨学科新领域

本文系统地提出基于“以人为中心AI(HCAI)”理念的人-人工智能交互(人智交互)这一跨学科新领域及框架,定义人智交互领域的理念、基本理论和关键问题、方法、开发流程和参与团队等,阐述提出人智交互新领域的意义。然后,提出人智交互研究的三种新范式取向以及它们的意义。最后,总结…...

MySQL:分区的基本使用

目录 一、什么是分区二、有什么作用三、分类四、创建分区五、删除分区 一、什么是分区 MySQL 分区&#xff08;Partitioning&#xff09;是一种将单张表的数据逻辑上拆分成多个物理部分的技术。这些物理部分&#xff08;分区&#xff09;可以独立存储、管理和优化&#xff0c;…...