Veracity Q&A home login about faq

If I want more customised ones than "open" or "fixed" etc., how can I set them up?

Failing that, is there a recommended workflow for the status cases that are hardcoded?

asked Jan 30 at 09:54

Grey's gravatar image

Grey
1263813


There are a few of steps you'd need to take to accomplish this:

1. Add the new status choice to the sg_ztemplate__wit.json file in ../modules/scrum/zing (or a copy of that file)

Look for the "status" section; the list of possible choices is under the "allowed" property.

You might add:

"allowed" :
    [
        "open",
        "fixed",
        "verified",
        "wontfix",
        "invalid",
        // need a new comma here
        "duplicate",    
        // no comma here
        "needsqa"       
    ],

to indicate a waiting-for-QA status.

2. Tell your work item database to use this new template.

The steps here are:

  1. Read the file
  2. Parse it into an object
  3. Open the repository
  4. Open the database.
  5. Begin a transaction
  6. Set the template
  7. Commit
  8. Close the repo

In code, that's along these lines (error checking and exception handling removed for brevity):

var wit = sg.file.read("sg_ztemplate__wit_newstatus.json"); 
var t;
var repoName = "testrepo";

eval('t = ' + wit);

var repo = sg.open_repo(repoName);

var db = new zingdb(repo, sg.dagnum.WORK_ITEMS);
var ztx = db.begin_tx();
ztx.set_template(t);
ztx.commit();
repo.close();

That's the easy part, since the new template will follow that repo around wherever it's cloned, pushed or pulled.

But if you want to see that new status in your workitem edit/display page, you need to:

3. Edit .../ui/workitem.js

And maintain (or redo) those edits across instances and upgrades.

Look for the collection of status.addOption(...) lines, and append one with your new status(es) and the appropriate description(s):

status.addOption("open", "Open");
status.addOption("fixed", "Fixed");
status.addOption("verified", "Verified");
status.addOption("wontfix", "Won't Fix");
status.addOption("invalid", "Invalid");
status.addOption("duplicate", "Duplicate");
status.addOption("needsqa", "QA Needed");   // the new guy

drop-down status showing our new option

link

answered Jan 31 at 10:35

Paul%20Roub's gravatar image

Paul Roub ♦♦
1.6k81141

Thanks! I'll give that a go. I've marked it as answered even though I haven't actually tested it yet, but I'll post back here if I have problems.

(Jan 31 at 13:06) Grey
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×10
×5

Asked: Jan 30 at 09:54

Seen: 230 times

Last updated: Jan 31 at 13:06

powered by OSQA