如何以编程方式从 Jira Studio 中的问题编号获取源代码信息?

发布于 2024-10-22 20:39:20 字数 476 浏览 4 评论 0原文

JIRA Studio(“问题”区域,基本上是看起来像“JIRA”的部分)包括一个“源”选项卡。我们将其链接到我们的 Subversion 实例(通过在签入期间在消息中包含问题编号),这非常适合人工流程,但我无法在 JIRA、Subversion 或 Fisheye API 中找到获取此信息的方法关联。

理想情况下,我想在 JIRA api 上调用 getIssue 并让它返回 Subversion 修订 ID 以及它返回的所有其他信息,但我也会采取任何可用的解决方法!我很乐意使用 SOAP、XML-RPC、REST、命令行或信鸽。

这是 UI 中的样子,其中包含我想要显示的“源选项卡”数据(抱歉,新用户,无法直接发布图像): Jira 屏幕截图

JIRA Studio (the "Issues" area, which is basically the part that just looks like "JIRA") includes a Source Tab. We link this to our Subversion instance (by including an issue number in the Message during check-in), this work great for human processes, but I can't find a way in the JIRA, Subversion, or Fisheye APIs to get at this link.

Ideally, I'd like to call getIssue on the JIRA api and have it return the Subversion Revision IDs along with all the other info it returns, but I'd take any sort of work-around available too! I will happily deal with SOAP, XML-RPC, REST, Command-Line, or carrier pigeon.

Here is what it looks like in the UI with the "Source Tab" data I want shown (sorry, new user, can't post images directly):
Jira Screen Capture

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铁轨上的流浪者 2024-10-29 20:39:20

我自己没有尝试过,但如果您查看一下鱼眼插件,您会发现如何使用 EQL 查询访问该信息可能非常有启发性。
http://confluence.atlassian.com/display/FISHEYE/EyeQL+Reference+Guide

鱼眼插件代码摘录:
https://studio.plugins.atlassian.com/source/browse/~raw,r=157831/FISH/trunk/src/main/java/com/atlassian/jirafisheyeplugin/ChangeSetManagerImpl.java

`
公共ChangeSets getChangesetsForIssue(最终字符串issueKey,字符串projectKey){
SearchConfig searchConfig = new SearchConfig(fisheyeConfig.getMaxIssueChangeSets(), false, false, true,
SearchConfig.SEARCHTYPE_CHRONOLOGICAL);

    P4Query query = new P4Query() {
        public Object doQuery(FishEyeRepository rep, boolean searchJobId) throws IOException {
            EyeQLQuery query = new EyeQLQuery();
            query.setDir("/");
            if (searchJobId) {
                query.addWhereClause(WhereClauseFactory.issueKeyOrJobIdMatches(issueKey));
            } else {
                query.addWhereClause(WhereClauseFactory.issueKeyMatches(issueKey));
            }
            query.setOrderByDate(true);
            query.setGroupBy(EyeQLQuery.GROUP_BY_CHANGESET);
            query.addReturnClause("csid");
            return apiManager.callFisheye(rep, RestCommandFactory.query(query), CsIdParser.PARSER);
        }
    };

    ChangeSets changesets = searchForChangeSets(projectKey, query, searchConfig);
    changesets.applyFilter(new IssueKeyInCommentOrJobIdFilter(issueKey));
    return changesets;
}

`

I didn't try myself but if you have a look at the fisheye plugin, it might be very instructive how to access that information using an EQL query.
http://confluence.atlassian.com/display/FISHEYE/EyeQL+Reference+Guide

Code excerpt from the fisheye plugin:
https://studio.plugins.atlassian.com/source/browse/~raw,r=157831/FISH/trunk/src/main/java/com/atlassian/jirafisheyeplugin/ChangeSetManagerImpl.java

`
public ChangeSets getChangesetsForIssue(final String issueKey, String projectKey) {
SearchConfig searchConfig = new SearchConfig(fisheyeConfig.getMaxIssueChangeSets(), false, false, true,
SearchConfig.SEARCHTYPE_CHRONOLOGICAL);

    P4Query query = new P4Query() {
        public Object doQuery(FishEyeRepository rep, boolean searchJobId) throws IOException {
            EyeQLQuery query = new EyeQLQuery();
            query.setDir("/");
            if (searchJobId) {
                query.addWhereClause(WhereClauseFactory.issueKeyOrJobIdMatches(issueKey));
            } else {
                query.addWhereClause(WhereClauseFactory.issueKeyMatches(issueKey));
            }
            query.setOrderByDate(true);
            query.setGroupBy(EyeQLQuery.GROUP_BY_CHANGESET);
            query.addReturnClause("csid");
            return apiManager.callFisheye(rep, RestCommandFactory.query(query), CsIdParser.PARSER);
        }
    };

    ChangeSets changesets = searchForChangeSets(projectKey, query, searchConfig);
    changesets.applyFilter(new IssueKeyInCommentOrJobIdFilter(issueKey));
    return changesets;
}

`

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文