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实用脚本
官方文档链接地址: The Jira Cloud platform REST API 实用json请求脚本如下: {"fields": ["summary","status"],"jql": "project abc AND summary ~ 【%s】【coverity】 AND componentCoverity"…...

《C++ primer plus》精炼(OOP部分)——对象和类(5)
“学习是照亮心灵的火炬,它永不熄灭,永不止息。” 文章目录 类的自动和强制类型转换原始类型转换为自定义类型将自定义类型转换为原始类型 类的自动和强制类型转换 原始类型转换为自定义类型 可以用一个参数的构造函数来实现,例如ÿ…...
钉钉旧版服务端SDK支持异步方法的升级改造
最近项目中需要对接钉钉,有些钉钉 API 的访问需要使用旧版服务端 SDK 才能搞定,但是这个 SDK 使用的还是 .NET Framework 2.0 框架,不能跨平台部署,也不支持 async\await 的异步操作方法,Nuget 上也有其它用户改造的 .…...

【C语言】【数据存储】用%d打印char类型数据,猜结果是啥
题目代码如下: #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; }解题关键: 1.二进制存储:原码,反码,补码 互换 2.截断 3.整型…...

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

【PowerQuery】Excel的PowerQuery按需刷新
将数据通过PowerQuery 导入进来后,这里将进行数据分组运算,最终的数据计算结果将保存在Excel 表格中,图为销售统计结果。 在Excel中,如果我们希望进行销售统计的手动更新可以使用几种不同的方法来进行刷新: 刷新单一数据连接如果仅仅需要刷新单一数据连接的话我们可以通过…...
Django REST Farmowork初探
1.简介 Django REST framework (简称:DRF)是一个强大而灵活的 Web API 工具。 遵循RESTFullAPI风格,功能完善,可快速开发API平台。 官网文档: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方式安装驱动,多数情况不容易成功, 使用一下方法更佳: 1.查看合适显卡的驱动版本 ubuntu-drivers devices NVIDIA GeForce 驱动程序 - …...

信息安全三级真题一
目录 一、单选题 二、填空题 三、综合题 一、单选题 二、填空题 三、综合题 知法懂法,请各位网络安全从业者遵守《网络安全法》、《个人信息保护法》 业%$务*$&联&#系 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仿真验证
数字滤波器的设计,本项目做的数字滤波器准确来说是FIR滤波器。 FIR滤波器(有限冲激响应滤波器),与另一种基本类型的数字滤波器——IIR滤波器(无限冲击响应滤波器)相对应,其实就是将所输入的信号…...

高速信号处理板资料保存:383-基于kintex UltraScale XCKU060的双路QSFP+光纤PCIe 卡设计原理图
基于kintex UltraScale XCKU060的双路QSFP光纤PCIe 卡 一、板卡概述 本板卡系我司自主研发,基于Xilinx UltraScale Kintex系列FPGA XCKU060-FFVA1156-2-I架构,支持PCIE Gen3 x8模式的高速信号处理板卡,搭配两路40G QSFP接口…...

QT:使用分组框、单选按钮、普通按钮、标签、行编辑器、垂直分布、水平分布做一个小项目
widget.h #ifndef WIDGET_H #define WIDGET_H#include <QWidget> #include <QRadioButton> //单选按钮 #include <QGroupBox> //分组框 #include <QHBoxLayout> //水平布局 #include <QVBoxLayout> //垂直布局 #include <QPushButton>…...
封装微信小程序隐私信息授权
隐私 代码 html (modal 组件再后面封装有提供) <modal isShow"{{show}}"><view class"privacy-auth-dialog"><view class"title">温馨提示</view><view class"content"><vi…...

【C#】FileInfo类 对文件进行操作
提示:使用FileInfo类时,要引用System.IO命名空间。 using System.IO; FileInfo类 生成文件删除文件移动文件复制文件获取文件名判断文件是否存在属性列表其它常用方法 生成文件 Create():在指定路径上创建文件。 FileInfo myFile new FileIn…...
python中的字符串也是可迭代对象吗?
python中的字符串也是可迭代对象吗? ━━━━━━━━━━━━━━━━━━━━━━ 是的,Python中的字符串是可迭代对象。这意味着你可以像处理列表或元组那样处理字符串。例如,你可以使用for循环遍历字符串中的每个字符,或…...
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月正式发布模板市场(https://dataease.io/templates/)。模板市场旨在为DataEase用户提供专业、美观、拿来即用的仪表板模板,方便用户根据自身的业务需求和使用场景选择对应的仪表板模板&a…...

测试微信模版消息推送
进入“开发接口管理”--“公众平台测试账号”,无需申请公众账号、可在测试账号中体验并测试微信公众平台所有高级接口。 获取access_token: 自定义模版消息: 关注测试号:扫二维码关注测试号。 发送模版消息: import requests da…...

业务系统对接大模型的基础方案:架构设计与关键步骤
业务系统对接大模型:架构设计与关键步骤 在当今数字化转型的浪潮中,大语言模型(LLM)已成为企业提升业务效率和创新能力的关键技术之一。将大模型集成到业务系统中,不仅可以优化用户体验,还能为业务决策提供…...

【入坑系列】TiDB 强制索引在不同库下不生效问题
文章目录 背景SQL 优化情况线上SQL运行情况分析怀疑1:执行计划绑定问题?尝试:SHOW WARNINGS 查看警告探索 TiDB 的 USE_INDEX 写法Hint 不生效问题排查解决参考背景 项目中使用 TiDB 数据库,并对 SQL 进行优化了,添加了强制索引。 UAT 环境已经生效,但 PROD 环境强制索…...

IoT/HCIP实验-3/LiteOS操作系统内核实验(任务、内存、信号量、CMSIS..)
文章目录 概述HelloWorld 工程C/C配置编译器主配置Makefile脚本烧录器主配置运行结果程序调用栈 任务管理实验实验结果osal 系统适配层osal_task_create 其他实验实验源码内存管理实验互斥锁实验信号量实验 CMISIS接口实验还是得JlINKCMSIS 简介LiteOS->CMSIS任务间消息交互…...
爬虫基础学习day2
# 爬虫设计领域 工商:企查查、天眼查短视频:抖音、快手、西瓜 ---> 飞瓜电商:京东、淘宝、聚美优品、亚马逊 ---> 分析店铺经营决策标题、排名航空:抓取所有航空公司价格 ---> 去哪儿自媒体:采集自媒体数据进…...
Spring AI与Spring Modulith核心技术解析
Spring AI核心架构解析 Spring AI(https://spring.io/projects/spring-ai)作为Spring生态中的AI集成框架,其核心设计理念是通过模块化架构降低AI应用的开发复杂度。与Python生态中的LangChain/LlamaIndex等工具类似,但特别为多语…...
iOS性能调优实战:借助克魔(KeyMob)与常用工具深度洞察App瓶颈
在日常iOS开发过程中,性能问题往往是最令人头疼的一类Bug。尤其是在App上线前的压测阶段或是处理用户反馈的高发期,开发者往往需要面对卡顿、崩溃、能耗异常、日志混乱等一系列问题。这些问题表面上看似偶发,但背后往往隐藏着系统资源调度不当…...

基于PHP的连锁酒店管理系统
有需要请加文章底部Q哦 可远程调试 基于PHP的连锁酒店管理系统 一 介绍 连锁酒店管理系统基于原生PHP开发,数据库mysql,前端bootstrap。系统角色分为用户和管理员。 技术栈 phpmysqlbootstrapphpstudyvscode 二 功能 用户 1 注册/登录/注销 2 个人中…...

tauri项目,如何在rust端读取电脑环境变量
如果想在前端通过调用来获取环境变量的值,可以通过标准的依赖: std::env::var(name).ok() 想在前端通过调用来获取,可以写一个command函数: #[tauri::command] pub fn get_env_var(name: String) -> Result<String, Stri…...
华为OD最新机试真题-数组组成的最小数字-OD统一考试(B卷)
题目描述 给定一个整型数组,请从该数组中选择3个元素 组成最小数字并输出 (如果数组长度小于3,则选择数组中所有元素来组成最小数字)。 输入描述 行用半角逗号分割的字符串记录的整型数组,0<数组长度<= 100,0<整数的取值范围<= 10000。 输出描述 由3个元素组成…...