Menu
  • HOME
  • TAGS

Jira API issueLink connect two different instances

Tag: jira,jira-rest-api

So, I have 2 different instances of Jira (let it be A and B), but they are connected with each other.

I can create manually a link in an issue within A, pointing to an issue within B instance. So, I can track issues from other instances. But how will I do it with an API?

If there will be one instance I will use this: https://docs.atlassian.com/jira/REST/latest/#d2e5606

Is there a way to determine where it should put the "outward" issue?

Just as an addition - I don't want to use remoteLink, as it's not the same (it's just a raw link and I need a real "connection" with statuses changing).

UPDATE

I have added an answer, example bash script could be seen there

Best How To :

I found the answer.

1) We are making a query to the jira issue which are we going to link (endpoint is /rest/api/latest/issue/${JIRA_ISSUE})

curl -D- -u ${JIRA_U}:${JIRA_P} -X GET -H "Content-Type: application/json" -m 60 ${JIRA_SOURCE_LINK}

And extracting "id" field. This is the internal id of issue in jira "A"

2) Now we need to post a remote link to jira B '(/rest/api/latest/issue/${JIRA_ISSUE}/remotelink endpoint)' with the knowledge of what is the appId of jira A and what is the internal number of issue from (1) with type "com.atlassian.jira", see "globalId's" "issueId":

{
"globalId": "appId=0000-0000-000-000-000&issueId=101",
"application": {
    "type": "com.atlassian.jira",
    "name": "Jira name"
},
"relationship": "relates to",
"object": {
    "url": "https://jiraurl/browse/ISSUE-11",
    "title": "ISSUE-11",
    "icon": {},
    "status": {
        "icon": {}
    }
}

}

We will have it like: curl -D- -u ${JIRA_U}:${JIRA_P} -X POST -d '${JSON_TO_POST}' -H "Content-Type: application/json" -m 60 ${JIRA_LINK}

And it's done.

UPDATE

Bash script example https://github.com/fat-troll/snippets/blob/master/jira_2_instance_crosspost.sh

Jira API issueLink connect two different instances

jira,jira-rest-api

I found the answer. 1) We are making a query to the jira issue which are we going to link (endpoint is /rest/api/latest/issue/${JIRA_ISSUE}) curl -D- -u ${JIRA_U}:${JIRA_P} -X GET -H "Content-Type: application/json" -m 60 ${JIRA_SOURCE_LINK} And extracting "id" field. This is the internal id of issue in jira "A" 2)...

How to change the issue Type of an issue in JIRA via email?

asp.net-mvc,vb.net,jira

By default this cannot be done, but by using a couple of add-ons you can successfully get it to work: https://marketplace.atlassian.com/plugins/com.metainf.jira.plugin.emailissue https://marketplace.atlassian.com/plugins/com.javahollic.jira.jemh-ui...

JIRA attachment with REST API

python,json,rest,jira,jira-rest-api

You can only set issue fields during creation: https://docs.atlassian.com/jira/REST/latest/#d2e2786 You can add attachments to already existing issues by posting the content itself: https://docs.atlassian.com/jira/REST/latest/#d2e2035 Sou you have to do it in two steps....

How to call an external webservice from Jira?

web-services,jira

basically this feature is already built-in! It is called Webhooks: https://confluence.atlassian.com/display/JIRA/Managing+Webhooks Simple example: If you define such a Webhook the URL is invoked at every Issue update with all fields and also all fields that changed (before - after). You could intercept your desired step in the workflow transition in...

Jira Oauth: 401 Unauthorized in PHP oauth_problem=“signature_invalid”

php,oauth,jira,jira-rest-api

I am providing different Public key in Jira and in Application. After correction this issue it runs great.

Get notification in my client code

java,jira,jira-rest-java-api

What do you want to achieve? You want to have push notifications? There isn't any, IMHO. UPDATE: However, there is this WebHook thingy: https://confluence.atlassian.com/display/JIRA/Managing+Webhooks. I have no expertise with it, but it is promising, please read this short introduction also: http://blogs.atlassian.com/2012/10/jira-5-2-remote-integration-webhooks/. You are looking for something that gives you back...

Jira post function - get current issue ID / Key

jira,jira-plugin

I found solution: (...) private MutableIssue mutableIssue; public void execute(Map transientVars, Map args, PropertySet ps) throws WorkflowException { MutableIssue issue = (MutableIssue) getIssue(transientVars); System.out.println("Issue Id: " + issue.getId() + "\n"); } (...) Above code allows to get issue object from Jira post-function execute method level....

JIRA jql to get all users who have touched a ticket

jira,jql,jira-agile

To get all the issues where the assignee has changed then you could do: assignee changed However I don't believe there is a way that you can do a JQL to search for all issues where a user was assigned to it but no longer is short of creating your...

configure custom fields per project in jira

jira,atlassian,jira-plugin

Even if using the same custom field configuration scheme among multiple projects, you can still visit an individual custom field in the Custom Field configuration page and add a custom field context that provides different configuration options for the field for one or more projects. This is primarily useful for...

JIRA: How can i list down the tasks in which my name was mentioned in comment section?

filter,jira

Depending on the version of the JIRA you have. In general the command to look in text field is: TextField ~ "text" where TextField is any JIRA text field like Description, Comment, Summary or it could be your Custom field name more on the subject: https://confluence.atlassian.com/display/JIRA/Advanced+Searching#AdvancedSearching-Comments...

Jira / Cards assigned to a user in a given timeframe

jira,jql

Should be like: assignee was currentUser() DURING ("2014/08/01", "2014/10/31") From looking at the Advanced Searching documents....

Tomcat behind an apache proxy error on path

java,apache,tomcat,jira,mod-proxy

Using ProxyPass to change the path of a web application, as you can, usually ruins everything. Instead, you should do either this: ProxyPass /tomcat http://dev.debian.local:8088/tomcat ProxyPassReverse /tomcat http://dev.debian.local:8088/tomcat or this: ProxyPass / http://dev.debian.local:8088 ProxyPassReverse / http://dev.debian.local:8088 If you take the second option, re-name your "tomcat" web application to "ROOT" (case-sensitive:...

JIRA: How a Subtask can Create a Subtask

workflow,jira,parent,atlassian,jql

I Found that the Bob Swift Plugin "Create on Transition" Works very well. It lets you assign a post function to a subtask workflow and that post function lets you create another subtask off of the parent when the original subtask is transitioned. It solved my issue perfectly.

Am I able to retrieve a JIRA HTTP URL using a GET Request when I use CORS?

asp.net-mvc,vb.net,cors,jira

I have found out that the JIRA system that I was trying to pull information was not hosted online so that was the reason why I was not able to retrieve information and it was giving me the error: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:XXXXX'...

how to export issues retrived from a search filter as xml automatically in JIRA

php,jira,atlassian,jira-plugin,jira-rest-api

You can right click the Export to XML link while logged into JIRA and choose Copy Link Address if you are using Chrome. (Forget what it is in Firefox/IE/Safari/Etc.) This will give you a link like: https://dev-jira.myhost.com/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+test+and+issuetype+%3D+Story&tempMax=1000 Then you can use something to just hit that URL to download the...

Is the Jira feature 'JQL' (Jira Query Language) a threat for the security of my Jira installation?

jira,sql-injection,atlassian

If you are not logged in to the server, your query will not be executed and you will get no results. Unless the JIRA instance has been specifically set up to allow anonymous viewing of issues, such as jira.atlassian.com JQL is a separate language from SQL and does not suffer...

JIRA Hide fields in View

jira

There may be other easy ways to do this.but one solution that comes to my mind is use of Behaviours plugin.using this plugin can hide fields if certain user logged into the system. you can follow steps like this.. 1.install Behaviours plugin and create new behaviour then add mappings and...

Reading Jira Webhook POST data

java,servlets,jira,webhooks

You have to read the response body, not the parameters map. For that purpose you can use request.getInputStream(); or request.getReader(); method. PS: You can configure the web hook to post data to http://requestb.in/ so you can easily analyze the request parameters, the request body, the headers, etc....

Format Excel sheets export by JIRA-(JIRA custom reports)

vba,pivot,jira,jira-plugin,visual-studio-macros

After searching may ways to get an answer for the question I have found a way to solve this using macros. Step 1: I have created a new empty work sheet called "Sheet B" in the same Excel work book generated by the plugin. Step 2: write a macro code...

Sprint bugs changed since yesterday

jira

Something like: project = TEST and issueType = Bug and updated > -1d and sprint in openSprints() Would look in the Test Project for all Bugs updated within the past 1 Days and the issue is in an Open Sprint. Or you could use perhaps startOfDay(-1d) instead of -1d. See...

Jira SAL using PluginSettings

plugins,settings,jira,webwork,sal

It was easier than i thought. I simply had to inject the Settings as a dependency for my WebWork: public WebWorkAction(CustomProjectSettings settings){ this.settings = settings } The Settings-Class gets autowired by <component-import key="pluginSettingsFactory" interface="com.atlassian.sal.api.pluginsettings.PluginSettingsFactory" /> and by adding <component key="settingsComponent" class="com.xxx.CustomProjectSettings"> </component> ...

Javascript JIRA Extension not working on hover

javascript,jquery,plugins,jira,atlassian

I refactored your code and it works OK. The trick is to fill the tooltip inside the ajax callback function. AJS.toInit(function () { var url, issue_id, offset, x, y, jira_data, html, fixVersions, assignee, domain = document.location; // build url whatever it might be url = domain.protocol +'//'+ domain.hostname if (domain.port...

How to query Issues updated by membersOf(“TEAMX”) on Yesterday in JQL

jira,jql

If you have the free Script Runner plugin installed, you have a lot of JQL functions added. One of it is the workLogged (The link in that sentence points here). Cons It accepts only a username, not groups, nor roles. JIRA needs to be reindexed after plugin installation to use...

Jira: How to set Assignee to match parent's Custom Field Value

groovy,jira,jira-plugin

ACG, I wasn't able to get your answer to work, but I found a very similar script here that worked perfectly! Thank you so much for your help! import com.atlassian.jira.user.ApplicationUsers cfParent = customFieldManager.getCustomFieldObjectByName('Project Manager') parentMyFieldValue = transientVars["issue"].getCustomFieldValue(cfParent) issue.setAssignee(ApplicationUsers.toDirectoryUser(parentMyFieldValue)) For those looking at this answer with a similar problem. Place this...

Jira Errors with Calculated Number Field

jira,atlassian,jira-plugin

int i = (issue.get("customfield_11631") != null ? Integer.parseInt(issue.get("customfield_11631").toString()) : 0) made it work. great thanks @ThePavolC

Only include specific issues in maven-changes-plugin JIRA report

java,maven,report,jira,maven-plugin

Unfortunately, this appears to be a bug. The RestJiraDownloader that the plugin uses does not use the filter property at all. I filed an issue: https://issues.apache.org/jira/browse/MCHANGES-353. I actually checked out a local copy and fixed it and it works as expected. Hopefully I'll get some time to submit a patch....

how to create JIRA quick filter where assignee is Unassigned

jira

In your case, create filter and type in JQL: assignee = unassigned user Or if no assignee assignee is empty You can select the widget "filter result" to show the consequence on your dashboard....

Excluding properies for JIRA JQL search using REST API

jira,jira-rest-api

Is there a way we can filter out all other properties? There is no way to hide other properties of assignee....

Jira Integration in C# [closed]

c#,.net,jira

If you have access to the database, and want to read data that way, that's entirely possible using standard .NET objects, but you'll probably need to be decent at SQL to get the data out that you want. Here's how you can (try to) access the database: SqlDataReader rdr =...

Delete link on page in Confluence

jira,confluence,atlassian,jira-plugin

forget to post solution. You can use "conveyor" plugin to override confluence's file. So, you can easily modified pages. there is some step to do when you read documentation to work on conveyor. easily got whatever you want... thanks...

How to get all transitions for specified workflow

java,jira,jira-plugin

From what I can gather from the API documents, the WorkflowManager can be used to call getWorkflow(java.lang.String) which returns a JiraWorkflow based off the provided workflow name string. Then from that you should be able to get all the transitions in the workflow, I am just not sure what exactly...

Add custom workflow to “Create project” screen

jira

There is no way to set a user created workflow as the default but there is a issue opened with Atlassian created about it. (See JRA-9363) Your only option would be to create the project and then immediately change over its Workflow Scheme to be that of your custom one...

Python and JIRA get fields from specific issue

python,jira-rest-api,python-jira

Found using: print self.issue_object.raw which returns the raw json dictionary which can be iterate and manipulate....

jira-python package in pip has gone?

python,pip,jira

It might have been superceded or replaced by jira Install: $ pip install jira Quickstart: rom jira import JIRA jira = JIRA('https://jira.atlassian.com') issue = jira.issue('JRA-9') print issue.fields.project.key # 'JRA' print issue.fields.issuetype.name # 'New Feature' print issue.fields.reporter.displayName # 'Mike Cannon-Brookes [Atlassian]' ...

accessing transition history via JIRA REST API

jira,jira-rest-api

When you use expand=changelog, then all changes that have been done in issue are there. Exactly same info as in All tab in Activity section when viewing in web browser. When I send: http://jira.my.server.se/rest/api/2/issue/KEYF-42346?expand=changelog Under changelogkey I find list of histories. Each historyhas list of items. Those items are changes...

POST multiple worklogs in one JIRA Rest request

rest,curl,jira-rest-api

Sorry, but in JIRA only one worklog per on request: https://docs.atlassian.com/jira/REST/latest/#d2e795

Transition tab not visible -JIRA Suite Utilities Plugin

jira,jira-plugin

I have found what I missed.In default the transition tab module and most of the modules were disabled in the plugin. then i had to enable it manually.

How to call add account method for tempoplugin with post in C#

c#,httpwebrequest,http-post,jira,httpwebresponse

I fount the solution. The problem lied in permissions on Jira. After double checking with admins my code worked perfectly.

SQL Query for JIRA issues

sql,database,oracle11g,jira

I suppose you want to have one issue per row. This report won't be an easy one, there are some factors in the JIRA database structure which will make this slow. I've built a query that joins columns through rejoining the same tables to get the different values of interests....

Edit JIRA Issues Java Rest

java,rest,jira

Manged to find a way using the Jira REST and the Jersey Library. Currently, Jira's Java API supports reading and creating tickets but not editing. package jiraAlerting; import javax.net.ssl.TrustManager; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; public class restLab { WebResource webResource; static { //for localhost testing only javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(...

Update JIRA ticket status using REST API

curl,jira,jira-rest-api,jira-rest-java-api

Status is not a field in Jira and thus changing the same on fly is not possible. JIRA API doesn’t have provision for that. We have to follow the transitions and change accordingly. First, execute ‘http://localhost:8100/rest/api/latest/issue/MTF -2/transitions?expand=transitions.fields and know the id’s for transitions. For Eg: transition id for “Stop Progress”...

How can I consume a Json Payload from a webhook and display certain features of the Json in vb.net MVC?

json,asp.net-mvc,vb.net,jira,webhooks

This is how I got the Json Payload from the Webhook URL: Function URLEndpoint() As ActionResult Dim r As System.IO.StreamReader = New System.IO.StreamReader(HttpContext.Request.InputStream) Dim jsonAs String = r.ReadToEnd() Dim issue As oject= JsonConvert.DeserializeObject(Of object)(json) System.Diagnostics.Trace.TraceError(json) Then create the classes to have the correct information from the Webhook: Public Class object...

Python: Subprocess call with wget - Scheme Missing

python,jira,wget

Try removing the quotes from the JIRA_URL. You don't need to use quotes to group arguments to subprocess.call, since they're already split into the list of arguments you pass in. FILTER_ID = 10000 USERNAME = 'myusername' PASSWORD = 'mypassword' # No extra quotes around the URL JIRA_URL = 'https://myjiraserver.com/sr/jira.issueviews:searchrequest-excel-all-fields/%d/SearchRequest-%d.xls?tempMax=1000&os_username=%s&os_password=%s' %...