I am trying to use Atlassian.SDK 11.2.0 to link an issue to an epic, with the following link of code:
issue.CustomFields.Add("Epic Link", "MyEpic01");
where "Epic Link" is my field name, and "MyEpic01" is the epic I want to link my issue to.
However, when I run my program, I have an run-time error as below:
InvalidOperationException: Response Status Code: 400. Response Content: {errorMessage":["gh.epic.error.not.found"],"errors":[]}
However, I do not this problem if I create an issue and link it to the epic manually in the JIRA interface,
I saw another post that mentioned something that I need "Greenhopper" API.
However, I am not quite familiar with Greenhopper API and need more information on this. Or, is it possible to make my code work without Greenhopper?
Thanks for your help.
My problem has been solved. Below is what I did:
In order to link an issue to an epic, the following conditions must be met:
1. The epic must already exist.
2. The issue that will be linked to that epic should have been created.
Then, the program can execute this line of code:
issue.CustomFields.Add("Epic Link", epicKey);
Where epicKey is the ticket number (or issue key) of the epic you want to link. Note that it is the issue key that is to be linked, not epic name.
Say, we have an epic name "MyEpic01", which itself is an issue, and its issue key is "Project-135". When doing the Epic Link, we are linking the issue to that epic using its ticket number as the identifier.
Therefore, if we were to hard-code the Epic Link, that is what to write:
issue.CustomFields.Add("Epic Link", "Project-135");
After the Epic Link is done, don’t forget to save our work, as below:
issue = await issue.SaveChangesAsync();
Now the code to link a Jira ticket to its corresponding Epic should work.
By the way, the error message is a bit odd, but it actually means the epic cannot be found. The error has nothing to do with Greenhopper.
I am getting this error in automating the Epic Link.
I setup a manual automation to test this and used it on an issue that already has an Epic Link to test if it will successfully set the Epic link to the Epic that it had. This way I know the Epic does exist.
Prior to automation I can test in JQL with project = "my epics project" and issuetype = epic and summary ~ "123456" which gives me one row, one epic.
In automation I then create a variable (epicKey) as project = "my project" and issutype = epic and summary ~ {{issue.customfield_#####}}. Since I am using smart values Jira cannot validate the JQL (standard functionality).
Now when I set Epic Link to {{epicKey}} it raises the error suggesting the Epic is not found. Since I know it exists it must be something wrong with the variable epicKey definition.
Any help would be appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.