const httpClient = await addon.httpClient({ addon: addon, clientKey: '5d5659b6-09f0-3482-bfa2-0405c4818f1e' });
httpClient.get('rest/api/3/project', function (err, response, body) {
res.send(`body = ${body}`);
});
//success
const httpClient = await addon.httpClient({ addon: addon, clientKey: '5d5659b6-09f0-3482-bfa2-0405c4818f1e' });
httpClient.del({ url: 'rest/api/3/project/10002',
headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'X-Atlassian-Token': 'nocheck' } },
(err, response, body) => {
err
? res.methodsend(`body = ${err.error_description}`)
: res.send(`body = ${body}`) });
//Forbidden(403)
If you use node.js ,so,you can use jira-npm complete the operation of the Jira issue.
Hi @zzw8200465323 ,
I am not sure I have a correct understanding of what you are asking for in here. However, what I understand is that:
If this is correct, then can you make sure you have the proper permissions/scope?
Delete project
DELETE /rest/api/3/project/{projectIdOrKey}
Deletes a project.
Permissions required: Administer Jira global permission.
App scope required:
PROJECT_ADMIN
OAuth scopes required:manage:jira-configuration
Also, kindly notice that:
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dario B This problem has been solved, Because I used Jira npm,But I still have a question, where is the API for adding a child issue? What parameters need to be passed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In below page search for the example: "Creating a sub-task"
For further details, you may also want to have a look at the below threads:
let me know if this helps.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dario B Thank you very much, the subtask can already be created.
demo code:
const body = {
fields: {
parent: {
id: "10701"
},
project: {
id: 10100 //require?
},
summary: "summary",
issuetype: {
id: "10001" //require?
},
assignee: {
name: "zhangzhouwang"
}, /*reporter: { name: "zhangzhouwang" },*/
duedate: "2019-6-27",
description: "封装后创建的任务描述"
}
};
In my local jira, I see that the project id and issuetype are required. Is it mandatory? And these two fields I can't cancel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If this is the case, Is there an api query field's reqire state?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @zzw8200465323 ,
If you don't specify project-id and issuetype then Jira cannot possibly know where (under which project) to create the issue and what kind of issue (issuetype) has to be created. That's why those fields are necessary.
Also, as written in:
The fields that can be set on create, in either the fields parameter or the update parameter can be determined using the /rest/api/2/issue/createmeta resource. If a field is not configured to appear on the create screen, then it will not be in the createmeta, and a field validation error will occur if it is submitted.
Creating a sub-task is similar to creating a regular issue, with two important differences:
- the
issueType
field must correspond to a sub-task issue type (you can use/issue/createmeta
to discover sub-task issue types), and- you must provide a
parent
field in the issue create request containing the id or key of the parent issue.
I hope this helps.
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much for your help. If there are any problems, let me ask you again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi @Dario B
Very sorry, I am coming again...
Because I want to migrate jira data to our own service,
The way I found is basically only xml and database backup, but I also see the data export method inside the jira system, such as excel, but the data is not complete, and the attachment can not be exported. Do you have any recommended data migration method?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or do you have a document in the database data format?Such as getting all issues and attachments and comments, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And the export inside jira can only have a maximum of 1000, how can I export more?
The local address is like this
http://localhost:9001/sr/jira.issueviews:searchrequest-fullcontent/temp/SearchRequest.html?jqlQuery=project+in+%28ZHANGZHOUW%2C+TEST%29&tempMax=1000
parameters do I need to add?
I tried start and startAt , but not
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@zzw8200465323 , Please notice that this question has nothing to do with the original topic and it should be posted in a new thread (also because this thread is marked as solved).
For the rest, the way to export more than 1000 issues to CSV is explained in the below KB:
By searching the community you can find many threads discussing this same topic and adding also some alternative approaches like, e.g. (search the community for more if needed):
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.