Jira: Difference between revisions

From Starfish ETL
Jump to navigation Jump to search
(Created page with "=Connector= The Jira connector is fairly standard. It asks for your username, password and URL. Your URL will be something like: https://starfishetl.atlassian.net. Your "pa...")
 
No edit summary
Line 1: Line 1:
=Connector=
=Connector=
The Jira connector is fairly standard.  It asks for your username, password and URL.  Your URL will be something like: https://starfishetl.atlassian.net.  Your "password" may not be your password.  In some, or all, accounts, you must supply an API key as your password.  To generate an API key, as of this writing, open the "Settings" gear icon -> Atlassian Account Settings -> Security -> Create and manage API tokens.  Create a Token for Starfish to use and put that into the "password" field.
The Jira connector is fairly standard.  It asks for your username, password and URL.  Your URL will be something like: https://starfishetl.atlassian.net.  Your "password" may not be your password.  In some, or all, accounts, you must supply an API key as your password.  To generate an API key, as of this writing, open the "Settings" gear icon -> Atlassian Account Settings -> Security -> Create and manage API tokens.  Create a Token for Starfish to use and put that into the "password" field.
=Inserting a File=
To insert a file, create an Insert Stage for the attachment table.
<syntaxhighlight lang="csharp">
object ScriptedField()
{
    string result;
    result = "";
object att;
byte[] data = Encoding.ASCII.GetBytes("");
//Starfish.LogMessage(Starfish.GetJSON(attachmentIndex,"id"));
att = Starfish.SmartLookup("Notes","attachment","[{\"id\":\"" + Starfish.GetJSON(attachmentIndex,"id") + "\"}]",false,"","ORIGIN");
if (att == null) {
        //If the returned object is null, we do not want to insert no attachment.
      Starfish.GotoNextRow();
    }
return att;
}
</syntaxhighlight>

Revision as of 11:41, 12 August 2021

Connector

The Jira connector is fairly standard. It asks for your username, password and URL. Your URL will be something like: https://starfishetl.atlassian.net. Your "password" may not be your password. In some, or all, accounts, you must supply an API key as your password. To generate an API key, as of this writing, open the "Settings" gear icon -> Atlassian Account Settings -> Security -> Create and manage API tokens. Create a Token for Starfish to use and put that into the "password" field.

Inserting a File

To insert a file, create an Insert Stage for the attachment table.

object ScriptedField()
{
    string result;
    result = "";
	object att;
	byte[] data = Encoding.ASCII.GetBytes("");
	//Starfish.LogMessage(Starfish.GetJSON(attachmentIndex,"id"));
	att = Starfish.SmartLookup("Notes","attachment","[{\"id\":\"" + Starfish.GetJSON(attachmentIndex,"id") + "\"}]",false,"","ORIGIN");
	if (att == null) {
        //If the returned object is null, we do not want to insert no attachment.
       Starfish.GotoNextRow();
    }
	return att;
}