1

How to assign project category to a project using JIRA rest apis.
My Jira server version is 6.3.13

Pradnya Mhatre
  • 208
  • 2
  • 8

1 Answers1

-1

All the following is using python!

If you are creating a new issue you can do it in two different ways, the first being a dict:

    issue_dict = {
        'project': {'id': 123},
        'summary': 'New issue from jira-python',
        'description': 'Look into this one',
        'issuetype': {'name': 'Bug'},
        }
    new_issue = jira.create_issue(fields=issue_dict)

The second way is to do it all in the function call:

    new_issue = jira.create_issue(project='PROJ_key_or_id', summary='New issue from jira-python',
                          description='Look into this one', issuetype={'name': 'Bug'})

However if you are updating a existing issue then you have to use the .update() function. Which would look like this:

    new_issue.update(issuetype={'name' : 'Bug'})

Source: http://pythonhosted.org/jira/

Fr3dBear
  • 16
  • 3
  • Sorry, but question is related to assigning project category to project not about creating issue. And there is no project update method at https://github.com/pycontribs/jira/blob/master/jira/resources.py – Pradnya Mhatre Oct 27 '15 at 14:38
  • 1
    It appears that you are actually using two different accounts. Your edit to this answer ended up in the edit review queue because you weren't logged in to the same account when you made the edit. Please follow the instructions [here](http://stackoverflow.com/help/merging-accounts) to get your accounts merged. I have rejected this edit for now since I can't be sure it's from the same person, but you can log back onto your original account and approve your edit if you want it applied. – skrrgwasme Nov 03 '15 at 18:56
  • It looks like you originally posted this answer with an "Unregistered Account" (see [here](http://meta.stackoverflow.com/q/262909/2615940) for more info about these), but made your edit while logged in to your normal account. – skrrgwasme Nov 03 '15 at 19:01
  • @PradnyaMhatre You are correct there is no update function, I would say to edit the meta but it looks as though you cant do that either, it looks as though from what i see after the project is created you cant change anything about it. I believe as long as you have admin rights you should be able to edit it using the webpage. **If you want to create the project:** you can just use the dict option with a `'projectCategory' : 'test project cagegory'` I'll keep looking. – Fr3dBear Nov 04 '15 at 17:00
  • @PradnyaMhatre the update() function does exist for the type project, however when trying to use it i get a HTTP 405 error `Method Not Allowed` (I tried `project = jira.project(testproject)` then `project.update()`) I believe that atlassian has a forum you could probably post something over there, you might get a better answer. – Fr3dBear Nov 04 '15 at 17:56