Default project for draft issue

I am a member of two projects A (primary) and B (secondary).
 
When I create the issue draft with parameter "draftId={any_value_here}", like this:
then new issue is creating with assigned project B...
 
When I create the issue draft with parameter "draftId={null}" or without parameter "draftId" at all, like this:
then new issue is creating with assigned project A.
 
All the recent issue were created in project A.
Please let me know what can I change in settings for assigning project A every time I'm creating the issue draft with parameter "draftId={any_value_here}" because I can't change this format (it's from Slack integration).
Thank you.
3 comments
Comment actions Permalink

Hi! 

I'm Sergey from the YouTrack team. 

When I create the issue draft with parameter "draftId={any_value_here}", like this:
 
If you open a link with a draft id, you don't create a new draft. You open an existing draft that was already created. The project was selected at the time the draft was created. 

Both just create a new draft and always assign an ID as in your first example: draftId=2-55314

When you create a new draft, though, the following logic applies:
  • if you have a project context selected, then this project is always set in the draft:
  • if it's set to 'Everything', then the project the last issue was created in by this user is selected 

If you want a new draft to be created in a specific project, then you can always have the context preselected as shown in the screenshot above. 

If any questions appear, please let me know.
0
Comment actions Permalink

Hi Sergey,

Thank you for your reply.

For now it started work as I needed - maybe some cache issue...

Please help me with one issue still - when I create a draft then it's selecting my right project, default value for field (column) but no board is selecting. Is it possible to set the default board in the current project for drafts?

 

Thank you.

0
Comment actions Permalink

Hi!

For now it started work as I needed

Glad to hear!

but no board is selecting

Firstly, you can base a board on a query, then all issues that match the query are automatically added to the board. 

Also, you can adjust various issue properties automatically, including adding an issue to a board when a draft is created, via a workflow. A workflow allows you to customize various YouTrack processes. Basically, you write Javascript code using the predefined entities (objects) to manipulate how different issue-related things work in your YouTrack. If you are not familiar with this functionality, please refer to our tutorial.

Here's a sample that you can use as a basis for your own rule:

const entities = require('@jetbrains/youtrack-scripting-api/entities');
exports.rule = entities.Issue.onChange({
  title: 'clear-values',
  guard: (ctx) => {
    return ctx.issue.isNew;
  },
  action: (ctx) => {
    const issue = ctx.issue;
    issue.applyCommand('add Board <board name>')
  },
  requirements: {

  }
});

If any questions appear, please let me know.

0

Please sign in to leave a comment.