useblocks / sphinx-needs-enterprise

Sphinx-Needs Functions for enterprise users
http://useblocks.com/sphinx-needs-enterprise/
Other
5 stars 0 forks source link

sne import does not create "tags" in needs.json #40

Closed twodrops closed 2 years ago

twodrops commented 2 years ago

"tags" is a mandatory attribute for needimport. sni import does not create this which leads to import error.

danwos commented 2 years ago

@haiyangToAI: Please check also if other options are missing as well.

haiyangToAI commented 2 years ago

Hi @twodrops @danwos ,

When you use sne import to extract data from external services and store in a needs.json file, you need to config how the created needs object will look like, in other words, what options it shall have.

To do that, config the mappings in needs_services, add the options you want to have.

In this example: https://useblocks.com/sphinx-needs-enterprise/services/jira.html#config, there are four options: id, type, title, status. These are the default mappings. If you want the new created needs have 'tags' option, then just config 'tags' there.

danwos commented 2 years ago

You are right, this would be a solution.

I'm asking myself if there should be empty default parameters so that the generated needs.json is valid for Sphinx-Need via needimport.

So other elements like type, status, title are also mandatory and a user may forget to configure it.

Or at least we should throw a warning if mapping parameters are not configured so that it is not compatible with Sphinx-Needs.

twodrops commented 2 years ago

tags can be an empty list like 'status'

danwos commented 2 years ago

We will add a check for certain elements, that they must be set to create a valid need.json file.